summaryrefslogtreecommitdiff
path: root/Assistant
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 /Assistant
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 'Assistant')
-rw-r--r--Assistant/XMPP/Git.hs7
1 files changed, 4 insertions, 3 deletions
diff --git a/Assistant/XMPP/Git.hs b/Assistant/XMPP/Git.hs
index 97b974f82..54cc6596f 100644
--- a/Assistant/XMPP/Git.hs
+++ b/Assistant/XMPP/Git.hs
@@ -43,6 +43,7 @@ import Control.Concurrent
import System.Timeout
import qualified Data.ByteString as B
import qualified Data.Map as M
+import qualified Data.AssocList as A
{- Largest chunk of data to send in a single XMPP message. -}
chunkSize :: Int
@@ -114,13 +115,13 @@ xmppPush cid gitpush = do
env <- liftIO getEnvironment
path <- liftIO getSearchPath
- let myenv = M.fromList
+ let myenv = A.addEntries
[ ("PATH", intercalate [searchPathSeparator] $ tmpdir:path)
, (relayIn, show inf)
, (relayOut, show outf)
, (relayControl, show controlf)
]
- `M.union` M.fromList env
+ env
inh <- liftIO $ fdToHandle readpush
outh <- liftIO $ fdToHandle writepush
@@ -132,7 +133,7 @@ xmppPush cid gitpush = do
{- This can take a long time to run, so avoid running it in the
- Annex monad. Also, override environment. -}
g <- liftAnnex gitRepo
- r <- liftIO $ gitpush $ g { gitEnv = Just $ M.toList myenv }
+ r <- liftIO $ gitpush $ g { gitEnv = Just myenv }
liftIO $ do
mapM_ killThread [t1, t2]