move: --safe/--unsafe and potential drop race fix
move: Added --safe option, which makes move honor numcopies settings. Also --unsafe enables the default behavior, anticipating that the default may one day change. This commit was sponsored by Ethan Aubin.
This commit is contained in:
parent
ae530f043e
commit
af8546990d
11 changed files with 187 additions and 74 deletions
|
@ -50,7 +50,7 @@ seek o = allowConcurrentOutput $ do
|
|||
Batch -> batchInput Right (batchCommandAction . go)
|
||||
NoBatch -> withKeyOptions
|
||||
(keyOptions o) (autoMode o)
|
||||
(Command.Move.startKey (fromToOptions o) False)
|
||||
(Command.Move.startKey (fromToOptions o) Command.Move.RemoveNever)
|
||||
(withFilesInGit go)
|
||||
=<< workTreeItems (copyFiles o)
|
||||
|
||||
|
@ -59,7 +59,7 @@ seek o = allowConcurrentOutput $ do
|
|||
- sending non-preferred content. -}
|
||||
start :: CopyOptions -> FilePath -> Key -> CommandStart
|
||||
start o file key = stopUnless shouldCopy $
|
||||
Command.Move.start (fromToOptions o) False file key
|
||||
Command.Move.start (fromToOptions o) Command.Move.RemoveNever file key
|
||||
where
|
||||
shouldCopy
|
||||
| autoMode o = want <||> numCopiesCheck file key (<)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue