summaryrefslogtreecommitdiff
path: root/Command
diff options
context:
space:
mode:
Diffstat (limited to 'Command')
-rw-r--r--Command/Add.hs9
1 files changed, 4 insertions, 5 deletions
diff --git a/Command/Add.hs b/Command/Add.hs
index 323d1ed1e..df57ba6cd 100644
--- a/Command/Add.hs
+++ b/Command/Add.hs
@@ -55,11 +55,10 @@ lockDown file = do
liftIO $ preventWrite file
tmp <- fromRepo gitAnnexTmpDir
createAnnexDirectory tmp
- pid <- liftIO getProcessID
- let tmpfile = tmp </> "add" ++ show pid ++ "." ++ takeFileName file
- liftIO $ nukeFile tmpfile
- liftIO $ createLink file tmpfile
- return $ KeySource { keyFilename = file , contentLocation = tmpfile }
+ liftIO $ do
+ (tmpfile, _handle) <- openTempFile tmp (takeFileName file)
+ createLink file tmpfile
+ return $ KeySource { keyFilename = file , contentLocation = tmpfile }
{- Moves a locked down file into the annex. -}
ingest :: KeySource -> Annex (Maybe Key)