diff options
Diffstat (limited to 'Annex/Direct.hs')
-rw-r--r-- | Annex/Direct.hs | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/Annex/Direct.hs b/Annex/Direct.hs index 6e14c6b9b..356354aa9 100644 --- a/Annex/Direct.hs +++ b/Annex/Direct.hs @@ -151,8 +151,8 @@ addDirect file cache = do - Then the work tree is updated to reflect the merge, and - finally, the merge is committed and the real index updated. -} -mergeDirect :: Maybe Git.Ref -> Maybe Git.Ref -> Git.Branch -> Annex Bool -> Annex Bool -mergeDirect startbranch oldref branch resolvemerge = do +mergeDirect :: Maybe Git.Ref -> Maybe Git.Ref -> Git.Branch -> Annex Bool -> Git.Branch.CommitMode -> Annex Bool +mergeDirect startbranch oldref branch resolvemerge commitmode = do -- Use the index lock file as the temp index file. -- This is actually what git does when updating the index, -- and so it will prevent other git processes from making @@ -168,19 +168,19 @@ mergeDirect startbranch oldref branch resolvemerge = do createDirectoryIfMissing True d withIndexFile tmpi $ do - merged <- stageMerge d branch + merged <- stageMerge d branch commitmode r <- if merged then return True else resolvemerge mergeDirectCleanup d (fromMaybe Git.Sha.emptyTree oldref) - mergeDirectCommit merged startbranch branch + mergeDirectCommit merged startbranch branch commitmode liftIO $ rename tmpi reali return r {- Stage a merge into the index, avoiding changing HEAD or the current - branch. -} -stageMerge :: FilePath -> Git.Branch -> Annex Bool -stageMerge d branch = do +stageMerge :: FilePath -> Git.Branch -> Git.Branch.CommitMode -> Annex Bool +stageMerge d branch commitmode = do -- XXX A bug in git makes stageMerge unsafe to use if the git repo -- is configured with core.symlinks=false -- Using mergeNonInteractive is not ideal though, since it will @@ -190,7 +190,7 @@ stageMerge d branch = do -- <http://marc.info/?l=git&m=140262402204212&w=2> merger <- ifM (coreSymlinks <$> Annex.getGitConfig) ( return Git.Merge.stageMerge - , return Git.Merge.mergeNonInteractive + , return $ \ref -> Git.Merge.mergeNonInteractive ref commitmode ) inRepo $ \g -> merger branch $ g { location = Local { gitdir = Git.localGitDir g, worktree = Just d } } @@ -198,8 +198,8 @@ stageMerge d branch = do {- Commits after a direct mode merge is complete, and after the work - tree has been updated by mergeDirectCleanup. -} -mergeDirectCommit :: Bool -> Maybe Git.Ref -> Git.Branch -> Annex () -mergeDirectCommit allowff old branch = do +mergeDirectCommit :: Bool -> Maybe Git.Ref -> Git.Branch -> Git.Branch.CommitMode -> Annex () +mergeDirectCommit allowff old branch commitmode = do void preCommitDirect d <- fromRepo Git.localGitDir let merge_head = d </> "MERGE_HEAD" @@ -211,7 +211,7 @@ mergeDirectCommit allowff old branch = do msg <- liftIO $ catchDefaultIO ("merge " ++ fromRef branch) $ readFile merge_msg - void $ inRepo $ Git.Branch.commit False msg + void $ inRepo $ Git.Branch.commit commitmode False msg Git.Ref.headRef [Git.Ref.headRef, branch] ) liftIO $ mapM_ nukeFile [merge_head, merge_msg, merge_mode] |