aboutsummaryrefslogtreecommitdiff
path: root/Command/Smudge.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2015-12-29 16:36:21 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2015-12-29 16:36:21 -0400
commit32919e3eb4ba3c3bc368f9f7b43d15e45d321016 (patch)
tree32519060fe891dca857bb59a862d46d2e8069ff4 /Command/Smudge.hs
parent3c645368da1c9ee0e963fc60fe2ff9611bed92da (diff)
don't disable smudge filter while merging
The smudge filter does need to be run, because if the key is in the local annex already (due to renaming, or a copy of a file added, or a new file added and its content has already arrived), git merge smudges the file and this should provide its content. This does probably mean that in merge conflict resolution, git smudges the existing file, re-copying all its content to it, and then the file is deleted. So, not efficient.
Diffstat (limited to 'Command/Smudge.hs')
-rw-r--r--Command/Smudge.hs15
1 files changed, 1 insertions, 14 deletions
diff --git a/Command/Smudge.hs b/Command/Smudge.hs
index f17eeea2e..80c79554e 100644
--- a/Command/Smudge.hs
+++ b/Command/Smudge.hs
@@ -19,9 +19,6 @@ import Utility.InodeCache
import Types.KeySource
import Backend
import Logs.Location
-import Annex.Index (addGitEnv)
-import Utility.Env
-import qualified Git
import qualified Database.Keys
import qualified Data.ByteString.Lazy as B
@@ -59,7 +56,7 @@ smudge file = do
-- don't provide such modified content as it
-- will be confusing. inAnnex will detect such
-- modifications.
- ifM ((not <$> smudgeDisabled) <&&> inAnnex k)
+ ifM (inAnnex k)
( do
content <- calcRepo (gitAnnexLocation k)
liftIO $ B.putStr . fromMaybe b
@@ -69,16 +66,6 @@ smudge file = do
Database.Keys.addAssociatedFile k file
stop
--- Environment variable to disable smudging providing the content of keys.
-smudgeDisabled :: Annex Bool
-smudgeDisabled = liftIO $ isJust <$> getEnv smudgeDisableEnv
-
-smudgeDisableEnv :: String
-smudgeDisableEnv = "ANNEX_SMUDGE_DISABLE"
-
-withSmudgeDisabled :: (Git.Repo -> IO a) -> Annex a
-withSmudgeDisabled a = inRepo $ \r -> addGitEnv r smudgeDisableEnv "1" >>= a
-
-- Clean filter is fed file content on stdin, decides if a file
-- should be stored in the annex, and outputs a pointer to its
-- injested content.