summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Jackson <ijackson@chiark.greenend.org.uk>2015-06-07 12:17:22 +0100
committerIan Jackson <ijackson@chiark.greenend.org.uk>2015-06-07 13:45:48 +0100
commit84026aec1f98aaeb69a751c89a25c55b355c7ee8 (patch)
tree9a046554f8617593f6523db635589f2f690debd6
parente0cf379ca6f4d10e6fa6a1af359859ea681dbb41 (diff)
Test suite: t-git-get-ref: check that argument starts with ref/
-rw-r--r--tests/lib4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/lib b/tests/lib
index 9948c31..0ae9bbc 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; }