summaryrefslogtreecommitdiff
path: root/Annex
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2017-10-16 12:57:28 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2017-10-16 12:57:28 -0400
commitfb899e75cf1ac84f3fd61ea39288811bacddee2c (patch)
tree4a988fc245f8bae27bbe7deac859378a4863f7dd /Annex
parentb3da6b94a2cecef01b48a21d37f01df4b94b01e8 (diff)
add: Replace work tree file atomically.
Before, there was a window where interrupting an add could result in the file being moved into the annex, with no symlink yet created. This commit was supported by the NSF-funded DataLad project.
Diffstat (limited to 'Annex')
-rw-r--r--Annex/Ingest.hs4
1 files changed, 1 insertions, 3 deletions
diff --git a/Annex/Ingest.hs b/Annex/Ingest.hs
index 4dabb1b58..5fdcd042c 100644
--- a/Annex/Ingest.hs
+++ b/Annex/Ingest.hs
@@ -128,9 +128,7 @@ ingestAdd' ld@(Just (LockedDown cfg source)) mk = do
Just k -> do
let f = keyFilename source
if lockingFile cfg
- then do
- liftIO $ nukeFile f
- addLink f k mic
+ then addLink f k mic
else ifM isDirect
( do
l <- calcRepo $ gitAnnexLink f k