chiark / gitweb /
Test suite: Change t-has-parent to t-has-parent-or-is
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 30 Oct 2016 22:06:24 +0000 (22:06 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 30 Oct 2016 22:46:35 +0000 (22:46 +0000)
This is only used by the inarchivecopy test.  And that ought not to
fail if there is no into-suite pseudomerge: that is, when the suite
branch contains the intended commit, rather than something merging the
intended commit into the suite branch.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
tests/lib
tests/tests/inarchivecopy

index 6c55cba2a579fa83e4434972eea9b54831765c76..23daeace743e6e06e0fa36c5e81bdee43670eaa1 100644 (file)
--- a/tests/lib
+++ b/tests/lib
@@ -198,11 +198,11 @@ t-has-ancestor () {
        fi
 }
 
-t-has-parent () {
-       # t-has-parent CHILD PARENT
+t-has-parent-or-is () {
+       # t-has-parent-or-is CHILD PARENT
        local child=$1
        local parent=$2
-       local parents=$(git show --pretty=format:' %P ' "$child")
+       local parents=$(git show --pretty=format:' %P %H ' "$child")
        parent=$(git rev-parse "$parent~0")
        case "$parents" in
        *" $parent "*)  ;;
index 394a21483ea6e64cd1f0172e02ad189f85b0e8ca..c83a5d36fffe4c6bc871e7d9454ed0b11d16533e 100755 (executable)
@@ -21,7 +21,7 @@ copy-check-good () {
        git diff $vtag
        t-refs-same refs/remotes/dgit/dgit/stable
        t-ref-head
-       t-has-parent HEAD $vtag
+       t-has-parent-or-is HEAD $vtag
 }
 
 copy-check () {