Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#7566 change the comments in the operations.DeleteFile as it does not use --backup-dir, despite comment #7621

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions fs/operations/operations.go
Original file line number Diff line number Diff line change
Expand Up @@ -485,8 +485,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() {
Expand Down Expand Up @@ -519,8 +519,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)
}
Expand Down
2 changes: 1 addition & 1 deletion fs/sync/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,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)
}
Expand Down