From 9de9f5aad4ec0275e3c544fcb26588ea0e755760 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 6 Apr 2016 18:40:28 -0400 Subject: run out of tree merge with --no-ff This is how direct mode does it too, and somehow, for reasons that currently escape me, this makes git merge not care if it's run with an empty work tree. --- Git/Merge.hs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'Git') diff --git a/Git/Merge.hs b/Git/Merge.hs index b3a048937..21eeaf181 100644 --- a/Git/Merge.hs +++ b/Git/Merge.hs @@ -15,12 +15,15 @@ import Git.Branch (CommitMode(..)) {- Avoids recent git's interactive merge. -} mergeNonInteractive :: Ref -> CommitMode -> Repo -> IO Bool -mergeNonInteractive branch commitmode +mergeNonInteractive = mergeNonInteractive' [] + +mergeNonInteractive' :: [CommandParam] -> Ref -> CommitMode -> Repo -> IO Bool +mergeNonInteractive' extraparams branch commitmode | older "1.7.7.6" = merge [Param $ fromRef branch] | otherwise = merge $ [Param "--no-edit", Param $ fromRef branch] where - merge ps = runBool $ cp ++ [Param "merge"] ++ ps - cp + merge ps = runBool $ sp ++ [Param "merge"] ++ ps ++ extraparams + sp | commitmode == AutomaticCommit = [Param "-c", Param "commit.gpgsign=false"] | otherwise = [] -- cgit v1.2.3