diff options
| author | Joey Hess <joeyh@joeyh.name> | 2016-08-20 14:58:34 -0400 |
|---|---|---|
| committer | Joey Hess <joeyh@joeyh.name> | 2016-08-20 14:58:34 -0400 |
| commit | fbe5a561d0636108fc025c1bcd28a522bcc6f381 (patch) | |
| tree | a17f5c69836dd293bb916284ece8f962061a5ef4 | |
| parent | 845d9de7ab790a1691237c8f3b7a6bf8787b3489 (diff) | |
improve Sean's fix, making the wrapper still work with older git versions
| -rw-r--r-- | debian/changelog | 5 | ||||
| -rw-r--r-- | src/Propellor/DotDir.hs | 12 |
2 files changed, 13 insertions, 4 deletions
diff --git a/debian/changelog b/debian/changelog index 9268d51d..425dd9e3 100644 --- a/debian/changelog +++ b/debian/changelog @@ -7,9 +7,8 @@ propellor (3.1.2) UNRELEASED; urgency=medium Thanks, Sean Whitton. [ Sean Whitton ] - * Pass --allow-unrelated-histories to git merge. - This fixes the /usr/bin/propellor wrapper for git 2.9.x. - - Propellor now requires git to be at least version 2.9. + * Pass --allow-unrelated-histories to git merge when run with git 2.9 or + newer. This fixes the /usr/bin/propellor wrapper with this version of git. -- Joey Hess <id@joeyh.name> Sun, 24 Jul 2016 13:34:37 -0400 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 |
