summaryrefslogtreecommitdiff
path: root/Command/Add.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Command/Add.hs')
-rw-r--r--Command/Add.hs4
1 files changed, 3 insertions, 1 deletions
diff --git a/Command/Add.hs b/Command/Add.hs
index b4141d06f..245ca2bd6 100644
--- a/Command/Add.hs
+++ b/Command/Add.hs
@@ -31,6 +31,7 @@ import Config
import Utility.InodeCache
import Annex.FileMatcher
import Annex.ReplaceFile
+import Utility.Tmp
def :: [Command]
def = [notBareRepo $ command "add" paramPaths seek SectionCommon
@@ -105,7 +106,8 @@ lockDown file = ifM (crippledFileSystem)
unlessM (isDirect) $ liftIO $
void $ tryIO $ preventWrite file
liftIO $ catchMaybeIO $ do
- (tmpfile, h) <- openTempFile tmp (takeFileName file)
+ (tmpfile, h) <- openTempFile tmp $
+ relatedTemplate $ takeFileName file
hClose h
nukeFile tmpfile
withhardlink tmpfile `catchIO` const nohardlink