aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Haggerty <mhagger@alum.mit.edu>2011-09-15 23:10:22 +0200
committerJunio C Hamano <gitster@pobox.com>2011-10-05 13:45:29 -0700
commitf9b1a5b9b8aab5d544666ca2aa227528f00484f1 (patch)
treec3367644a7d69add0b909fc02ddc53d4a09f737e
parentd4e85a1afe0a3310a3c8336c2824775901cc27d7 (diff)
downloadgit-f9b1a5b9b8aab5d544666ca2aa227528f00484f1.tar.gz
git-f9b1a5b9b8aab5d544666ca2aa227528f00484f1.tar.xz
t1402: add some more tests
The new tests reflect the status quo. Soon the rule for "*.lock" in refname components will be tightened up. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rwxr-xr-xt/t1402-check-ref-format.sh9
1 files changed, 9 insertions, 0 deletions
diff --git a/t/t1402-check-ref-format.sh b/t/t1402-check-ref-format.sh
index ed4275afe..dc4317100 100755
--- a/t/t1402-check-ref-format.sh
+++ b/t/t1402-check-ref-format.sh
@@ -13,6 +13,8 @@ invalid_ref() {
"test_must_fail git check-ref-format '$1'"
}
+invalid_ref ''
+invalid_ref '/'
valid_ref 'heads/foo'
invalid_ref 'foo'
valid_ref 'foo/bar/baz'
@@ -27,6 +29,9 @@ invalid_ref 'heads/foo..bar'
invalid_ref 'heads/foo?bar'
valid_ref 'foo./bar'
invalid_ref 'heads/foo.lock'
+invalid_ref 'heads///foo.lock'
+valid_ref 'foo.lock/bar'
+valid_ref 'foo.lock///bar'
valid_ref 'heads/foo@bar'
invalid_ref 'heads/v@{ation'
invalid_ref 'heads/foo\bar'
@@ -83,5 +88,9 @@ invalid_ref_normalized '/foo'
invalid_ref_normalized 'heads/foo/../bar'
invalid_ref_normalized 'heads/./foo'
invalid_ref_normalized 'heads\foo'
+invalid_ref_normalized 'heads/foo.lock'
+invalid_ref_normalized 'heads///foo.lock'
+valid_ref_normalized 'foo.lock/bar' 'foo.lock/bar'
+valid_ref_normalized 'foo.lock///bar' 'foo.lock/bar'
test_done