From 84026aec1f98aaeb69a751c89a25c55b355c7ee8 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sun, 7 Jun 2015 12:17:22 +0100 Subject: [PATCH] Test suite: t-git-get-ref: check that argument starts with ref/ --- tests/lib | 4 ++++ 1 file changed, 4 insertions(+) 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; } -- 2.30.2