chiark / gitweb /
Test suite: Do not fail when git requires --allow-unrelated-histories.
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 15 Oct 2016 23:06:37 +0000 (00:06 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 15 Oct 2016 23:06:41 +0000 (00:06 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
debian/changelog
tests/lib

index fc7d222a1554cd47c521ca71a5bef6f2f089a1aa..aceac203acf0649cbdaed8b5818a922d99e46ad6 100644 (file)
@@ -121,6 +121,7 @@ dgit (1.5~~) unstable; urgency=medium
   * tstunt arrangements: Fix mishandling of PERLLIB, etc.
   * tstunt-parsechangelog: Produce Timestamp field (like official one
     does, now).
+  * Do not fail when git requires --allow-unrelated-histories.
 
  --
 
index 3294cdc0faa62924daa92d7f853a97fb41fd56f8..b4642ae89556a05fb38699635ac898d39af224bd 100644 (file)
--- a/tests/lib
+++ b/tests/lib
@@ -764,6 +764,18 @@ t-gbp-unapplied-pq2qc () {
        git commit -m 'Commit patch queue'
 }
 
+t-git-pseudo-merge () {
+       # like   git merge -s ours
+       if [ ! "$git_pseuomerge_opts" ]; then
+               if git merge --help \
+                | grep -q allow-unrelated-histories; then
+                       git_pseuomerge_opts='--allow-unrelated-histories'
+               fi
+               git_pseuomerge_opts+=' -s ours'
+       fi
+       git merge $git_pseuomerge_opts "$@"
+}
+
 t-gbp-example-prep () {
        t-tstunt-parsechangelog
        t-archive example 1.0-1
@@ -785,7 +797,7 @@ t-gbp-example-prep () {
 
        t-commit 'some updates' 1.0-2
 
-       git merge -s ours \
+       t-git-pseudo-merge \
                -m 'Pseudo-merge to make descendant of archive' \
                remotes/dgit/dgit/sid
 }