summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2011-06-23 16:44:26 -0400
committerGravatar Joey Hess <joey@kitenet.net>2011-06-23 16:44:26 -0400
commit1686f60f8481e996291a5970b2217bc1d64f635d (patch)
treeafcdd6318fba41d27496089e405385da1025ee03
parent7981eb4cb512fbe3c49a3dd165c31be14ae4bc49 (diff)
commit after merge if any journal files were staged
-rw-r--r--Branch.hs9
1 files changed, 2 insertions, 7 deletions
diff --git a/Branch.hs b/Branch.hs
index e79ca3f60..6e9dae9b9 100644
--- a/Branch.hs
+++ b/Branch.hs
@@ -156,19 +156,14 @@ update = do
-
- It would be cleaner to handle the merge by updating the
- journal, not the index, with changes from the branches.
- -
- - XXX Anything written to the journal during the merge,
- - by another process could still race the merge. The
- - journal should really be blocking locked during the
- - merge.
-}
- _ <- stageJournalFiles
+ staged <- stageJournalFiles
g <- Annex.gitRepo
r <- liftIO $ Git.pipeRead g [Param "show-ref", Param name]
let refs = map (last . words) (lines r)
updated <- catMaybes `liftM` mapM updateRef refs
- unless (null updated) $ liftIO $
+ unless (null updated && not staged) $ liftIO $
GitUnionMerge.commit g "update" fullname
(fullname:updated)
Annex.changeState $ \s -> s { Annex.branchstate = state { branchUpdated = True } }