diff options
author | Joey Hess <joey@kitenet.net> | 2014-06-09 20:32:11 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2014-06-09 20:32:11 -0400 |
commit | c754630b04285d7bb954248584343bb714280dfc (patch) | |
tree | 0d6639fdf64cae5de4eabf830e205c681e02ab0f | |
parent | f4308b107242781b5de98804eb68a9657b348c49 (diff) |
simplify
-rw-r--r-- | Annex/AutoMerge.hs | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/Annex/AutoMerge.hs b/Annex/AutoMerge.hs index 22d3332dd..71b28c1d4 100644 --- a/Annex/AutoMerge.hs +++ b/Annex/AutoMerge.hs @@ -39,7 +39,7 @@ autoMergeFrom branch currbranch = do go old = ifM isDirect ( mergeDirect currbranch old branch (resolveMerge old branch) , inRepo (Git.Merge.mergeNonInteractive branch) - <||> resolveMerge old branch + <||> (resolveMerge old branch <&&> commitResolvedMerge) ) {- Resolves a conflicted merge. It's important that any conflicts be @@ -64,11 +64,11 @@ autoMergeFrom branch currbranch = do - - In indirect mode, the merge is resolved in the work tree and files - staged, to clean up from a conflicted merge that was run in the work - - tree. The resolution is committed. + - tree. - - - In direct mode, the work tree is not touched here, and no commit is made; - - files are staged to the index, and written to the gitAnnexMergeDir, and - - later mergeDirectCleanup handles updating the work tree. + - In direct mode, the work tree is not touched here; files are staged to + - the index, and written to the gitAnnexMergeDir, for later handling by + - the direct mode merge code. -} resolveMerge :: Maybe Git.Ref -> Git.Ref -> Annex Bool resolveMerge us them = do @@ -88,13 +88,6 @@ resolveMerge us them = do unlessM isDirect $ cleanConflictCruft mergedfs top Annex.Queue.flush - unlessM isDirect $ do - void $ inRepo $ Git.Command.runBool - [ Param "commit" - , Param "--no-verify" - , Param "-m" - , Param "git-annex automatic merge conflict fix" - ] showLongNote "Merge conflict was automatically resolved; you may want to examine the result." return merged @@ -172,3 +165,11 @@ cleanConflictCruft resolvedfs top = do s = S.fromList resolvedfs matchesresolved f = S.member (base f) s base f = reverse $ drop 1 $ dropWhile (/= '~') $ reverse f + +commitResolvedMerge :: Annex Bool +commitResolvedMerge = inRepo $ Git.Command.runBool + [ Param "commit" + , Param "--no-verify" + , Param "-m" + , Param "git-annex automatic merge conflict fix" + ] |