From: Ian Jackson Date: Sun, 7 Jun 2015 11:17:22 +0000 (+0100) Subject: Test suite: t-git-get-ref: check that argument starts with ref/ X-Git-Tag: debian/0.30~106 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=dgit.git;a=commitdiff_plain;h=84026aec1f98aaeb69a751c89a25c55b355c7ee8;ds=sidebyside Test suite: t-git-get-ref: check that argument starts with ref/ --- diff --git a/tests/lib b/tests/lib index 9948c314..0ae9bbc2 100644 --- a/tests/lib +++ b/tests/lib @@ -241,6 +241,10 @@ t-clean-on-branch () { t-git-get-ref () { local ref=$1 + case "$ref" in + refs/*) ;; + *) fail "t-git-get-ref bad $ref" ;; + esac git show-ref -d $1 | perl -ne ' $x = $1 if m#^(\w+) \Q'$1'\E(?:\^\{\})?$#; END { print "$x\n" if length $x; }