chiark / gitweb /
Test suite: Prepare for pipefail in t-git-get-ref
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 7 Jun 2015 12:43:15 +0000 (13:43 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 7 Jun 2015 12:45:49 +0000 (13:45 +0100)
tests/lib

index e960c1c..a0a84dd 100644 (file)
--- a/tests/lib
+++ b/tests/lib
@@ -245,7 +245,7 @@ t-git-get-ref () {
        refs/*) ;;
        *) fail "t-git-get-ref bad $ref" ;;
        esac
-       git show-ref -d $1 | perl -ne '
+       (git show-ref -d $1 || test $? = 1) | perl -ne '
                $x = $1 if m#^(\w+) \Q'$1'\E(?:\^\{\})?$#;
                END { print "$x\n" if length $x; }
        '