commit after merge if any journal files were staged

This commit is contained in:
Joey Hess 2011-06-23 16:44:26 -04:00
parent 7981eb4cb5
commit 1686f60f84

View file

@ -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 } }