exec 2>&1
set -x
+set -o pipefail
. tests/lib-core
t-expect-fail () {
local mpat="$1"; shift
+ set +o pipefail
LC_MESSAGES=C "$@" 2>&1 | tee $tmp/t.output
- test ${PIPESTATUS[0]} != 0
+ local gotstatus=${PIPESTATUS[0]}
+ set -o pipefail
+ test $gotstatus != 0
egrep "$mpat" $tmp/t.output ||false
}
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; }
'