Merge a27c8d73c57ff03fb851f661a44e8d01cffbdab3 into 4d38424e6cbb32d07c74d3b4d760af7afb35742d

This commit is contained in:
RONGALI-TARUN 2025-03-20 05:47:55 -04:00 committed by GitHub
commit 84921f3e9d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 5 deletions

View File

@ -541,8 +541,8 @@ func SuffixName(ctx context.Context, remote string) string {
// DeleteFileWithBackupDir deletes a single file respecting --dry-run
// and accumulating stats and errors.
//
// If backupDir is set then it moves the file to there instead of
// deleting
// If backupDir is set then it moves the file to there instead of deleting
// you use BackupDir to find the --backup-dir as it is relatively expensive so don't put it in a loop
func DeleteFileWithBackupDir(ctx context.Context, dst fs.Object, backupDir fs.Fs) (err error) {
tr := accounting.Stats(ctx).NewCheckingTransfer(dst, "deleting")
defer func() {
@ -575,8 +575,8 @@ func DeleteFileWithBackupDir(ctx context.Context, dst fs.Object, backupDir fs.Fs
// DeleteFile deletes a single file respecting --dry-run and accumulating stats and errors.
//
// If useBackupDir is set and --backup-dir is in effect then it moves
// the file to there instead of deleting
// call DeleteFileWithBackupDir if --backup-dir support is required
// as calling this function with --backup-dir will always returns nil
func DeleteFile(ctx context.Context, dst fs.Object) (err error) {
return DeleteFileWithBackupDir(ctx, dst, nil)
}

View File

@ -448,7 +448,7 @@ func (s *syncCopyMove) pairChecker(in *pipe, out *pipe, fraction int, wg *sync.W
return
}
} else {
deleteFileErr := operations.DeleteFile(s.ctx, src)
deleteFileErr := operations.DeleteFileWithBackupDir(s.ctx, src, s.backupDir)
s.processError(deleteFileErr)
s.logger(s.ctx, operations.TransferError, pair.Src, pair.Dst, deleteFileErr)
}