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 e960c1c62c33f60c76a27f83cd212aac0b8fcc2a..a0a84dda142143b49901a7549e6638a1331c0d62 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; }
        '