From fb899e75cf1ac84f3fd61ea39288811bacddee2c Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 16 Oct 2017 12:57:28 -0400 Subject: 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. --- Annex/Ingest.hs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'Annex') 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 -- cgit v1.2.3