From fbe5a561d0636108fc025c1bcd28a522bcc6f381 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 20 Aug 2016 14:58:34 -0400 Subject: improve Sean's fix, making the wrapper still work with older git versions --- src/Propellor/DotDir.hs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/Propellor/DotDir.hs') diff --git a/src/Propellor/DotDir.hs b/src/Propellor/DotDir.hs index cd079bca..21a9cdb7 100644 --- a/src/Propellor/DotDir.hs +++ b/src/Propellor/DotDir.hs @@ -401,7 +401,17 @@ setupUpstreamMaster newref = do changeWorkingDirectory tmprepo git ["fetch", distrepo, "--quiet"] git ["reset", "--hard", oldref, "--quiet"] - git ["merge", newref, "-s", "recursive", "-Xtheirs", "--quiet", "--allow-unrelated-histories", "-m", "merging upstream version"] + v <- gitVersion + let mergeparams = + [ "merge", newref + , "-s", "recursive" + , "-Xtheirs" + , "--quiet" + , "-m", "merging upstream version" + ] ++ if v >= [2,9] + then [ "--allow-unrelated-histories" ] + else [] + git mergeparams void $ fetchUpstreamBranch tmprepo cleantmprepo -- cgit v1.2.3