From baa5f0ff25f3a3833c46b1e0d60242bd9066eaae Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 7 Jan 2016 17:39:59 -0400 Subject: avoid confusing git with a modified ctime in clean filter Linking the file to the tmp dir was not necessary in the clean filter, and it caused the ctime to change, which caused git to think the file was changed. This caused git status to get slow as it kept re-cleaning unchanged files. --- Command/Add.hs | 6 +++++- Command/Smudge.hs | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) (limited to 'Command') diff --git a/Command/Add.hs b/Command/Add.hs index 8a7db0a91..b88dc52f7 100644 --- a/Command/Add.hs +++ b/Command/Add.hs @@ -115,7 +115,11 @@ start file = ifAnnexed file addpresent add perform :: FilePath -> CommandPerform perform file = do lockingfile <- not <$> isDirect - lockDown lockingfile file >>= ingest >>= go + let cfg = LockDownConfig + { lockingFile = lockingfile + , hardlinkFileTmp = True + } + lockDown cfg file >>= ingest >>= go where go (Just key, cache) = next $ cleanup file key cache True go (Nothing, _) = stop diff --git a/Command/Smudge.hs b/Command/Smudge.hs index 8b7d848d2..1ca3de2c3 100644 --- a/Command/Smudge.hs +++ b/Command/Smudge.hs @@ -72,7 +72,7 @@ clean file = do then liftIO $ B.hPut stdout b else ifM (shouldAnnex file) ( liftIO . emitPointer - =<< go =<< ingest =<< lockDown False file + =<< go =<< ingest =<< lockDown cfg file , liftIO $ B.hPut stdout b ) stop @@ -81,6 +81,10 @@ clean file = do logStatus k InfoPresent return k go _ = error "could not add file to the annex" + cfg = LockDownConfig + { lockingFile = False + , hardlinkFileTmp = False + } shouldAnnex :: FilePath -> Annex Bool shouldAnnex file = do -- cgit v1.2.3