aboutsummaryrefslogtreecommitdiff
path: root/Remote/Hook.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2014-01-14 15:36:33 -0400
committerGravatar Joey Hess <joey@kitenet.net>2014-01-14 15:36:33 -0400
commite6f32bd11c94221f82fe9acf6ecb74be2fab4a76 (patch)
treef52a5aa501875340c05f34c151fd027036cff83a /Remote/Hook.hs
parent44b6bc589b6e2219cd3a4cf57fd2dd30068b2744 (diff)
Fix a long-standing bug that could cause the wrong index file to be used when committing to the git-annex branch, if GIT_INDEX_FILE is set in the environment. This typically resulted in git-annex branch log files being committed to the master branch and later showing up in the work tree. (These log files can be safely removed.)
Diffstat (limited to 'Remote/Hook.hs')
-rw-r--r--Remote/Hook.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/Remote/Hook.hs b/Remote/Hook.hs
index 056ad264c..d2ce48ddb 100644
--- a/Remote/Hook.hs
+++ b/Remote/Hook.hs
@@ -9,6 +9,7 @@ module Remote.Hook (remote) where
import qualified Data.ByteString.Lazy as L
import qualified Data.Map as M
+import qualified Data.AssocList as A
import System.Environment
import Common.Annex
@@ -77,8 +78,7 @@ hookSetup mu c = do
hookEnv :: Action -> Key -> Maybe FilePath -> IO (Maybe [(String, String)])
hookEnv action k f = Just <$> mergeenv (fileenv f ++ keyenv)
where
- mergeenv l = M.toList . M.union (M.fromList l)
- <$> M.fromList <$> getEnvironment
+ mergeenv l = A.addEntries l <$> getEnvironment
env s v = ("ANNEX_" ++ s, v)
keyenv = catMaybes
[ Just $ env "KEY" (key2file k)