summaryrefslogtreecommitdiff
path: root/t/t1402-check-ref-format.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2014-09-09 19:53:54 (GMT)
committerJunio C Hamano <gitster@pobox.com>2014-09-09 19:53:54 (GMT)
commit50b335b783680d402974b096e216cd3e823cf6b5 (patch)
tree0a3976f895d60ffa3e5a4b87ccfa15b78e3cb3b7 /t/t1402-check-ref-format.sh
parent85f083786fe37f280ca30fc0b74498b22b322c6d (diff)
parentb0562224c93aca5addd994e37cd851b7a5de44b8 (diff)
downloadgit-50b335b783680d402974b096e216cd3e823cf6b5.zip
git-50b335b783680d402974b096e216cd3e823cf6b5.tar.gz
git-50b335b783680d402974b096e216cd3e823cf6b5.tar.bz2
Merge branch 'jc/not-mingw-cygwin'
We have been using NOT_{MINGW,CYGWIN} test prerequisites long before Peff invented support for negated prerequisites e.g. !MINGW and we still add more uses of the former. Convert them to the latter to avoid confusion. * jc/not-mingw-cygwin: test prerequisites: enumerate with commas test prerequisites: eradicate NOT_FOO
Diffstat (limited to 't/t1402-check-ref-format.sh')
-rwxr-xr-xt/t1402-check-ref-format.sh40
1 files changed, 20 insertions, 20 deletions
diff --git a/t/t1402-check-ref-format.sh b/t/t1402-check-ref-format.sh
index 4bc7141..e5dc62e 100755
--- a/t/t1402-check-ref-format.sh
+++ b/t/t1402-check-ref-format.sh
@@ -7,7 +7,7 @@ test_description='Test git check-ref-format'
valid_ref() {
prereq=
case $1 in
- [A-Z]*)
+ [A-Z!]*)
prereq=$1
shift
esac
@@ -19,7 +19,7 @@ valid_ref() {
invalid_ref() {
prereq=
case $1 in
- [A-Z]*)
+ [A-Z!]*)
prereq=$1
shift
esac
@@ -30,17 +30,17 @@ invalid_ref() {
}
invalid_ref ''
-invalid_ref NOT_MINGW '/'
-invalid_ref NOT_MINGW '/' --allow-onelevel
-invalid_ref NOT_MINGW '/' --normalize
-invalid_ref NOT_MINGW '/' '--allow-onelevel --normalize'
+invalid_ref !MINGW '/'
+invalid_ref !MINGW '/' --allow-onelevel
+invalid_ref !MINGW '/' --normalize
+invalid_ref !MINGW '/' '--allow-onelevel --normalize'
valid_ref 'foo/bar/baz'
valid_ref 'foo/bar/baz' --normalize
invalid_ref 'refs///heads/foo'
valid_ref 'refs///heads/foo' --normalize
invalid_ref 'heads/foo/'
-invalid_ref NOT_MINGW '/heads/foo'
-valid_ref NOT_MINGW '/heads/foo' --normalize
+invalid_ref !MINGW '/heads/foo'
+valid_ref !MINGW '/heads/foo' --normalize
invalid_ref '///heads/foo'
valid_ref '///heads/foo' --normalize
invalid_ref './foo'
@@ -120,14 +120,14 @@ invalid_ref "$ref" --refspec-pattern
invalid_ref "$ref" '--refspec-pattern --allow-onelevel'
ref='/foo'
-invalid_ref NOT_MINGW "$ref"
-invalid_ref NOT_MINGW "$ref" --allow-onelevel
-invalid_ref NOT_MINGW "$ref" --refspec-pattern
-invalid_ref NOT_MINGW "$ref" '--refspec-pattern --allow-onelevel'
-invalid_ref NOT_MINGW "$ref" --normalize
-valid_ref NOT_MINGW "$ref" '--allow-onelevel --normalize'
-invalid_ref NOT_MINGW "$ref" '--refspec-pattern --normalize'
-valid_ref NOT_MINGW "$ref" '--refspec-pattern --allow-onelevel --normalize'
+invalid_ref !MINGW "$ref"
+invalid_ref !MINGW "$ref" --allow-onelevel
+invalid_ref !MINGW "$ref" --refspec-pattern
+invalid_ref !MINGW "$ref" '--refspec-pattern --allow-onelevel'
+invalid_ref !MINGW "$ref" --normalize
+valid_ref !MINGW "$ref" '--allow-onelevel --normalize'
+invalid_ref !MINGW "$ref" '--refspec-pattern --normalize'
+valid_ref !MINGW "$ref" '--refspec-pattern --allow-onelevel --normalize'
test_expect_success "check-ref-format --branch @{-1}" '
T=$(git write-tree) &&
@@ -162,7 +162,7 @@ test_expect_success 'check-ref-format --branch from subdir' '
valid_ref_normalized() {
prereq=
case $1 in
- [A-Z]*)
+ [A-Z!]*)
prereq=$1
shift
esac
@@ -174,7 +174,7 @@ valid_ref_normalized() {
invalid_ref_normalized() {
prereq=
case $1 in
- [A-Z]*)
+ [A-Z!]*)
prereq=$1
shift
esac
@@ -185,10 +185,10 @@ invalid_ref_normalized() {
valid_ref_normalized 'heads/foo' 'heads/foo'
valid_ref_normalized 'refs///heads/foo' 'refs/heads/foo'
-valid_ref_normalized NOT_MINGW '/heads/foo' 'heads/foo'
+valid_ref_normalized !MINGW '/heads/foo' 'heads/foo'
valid_ref_normalized '///heads/foo' 'heads/foo'
invalid_ref_normalized 'foo'
-invalid_ref_normalized NOT_MINGW '/foo'
+invalid_ref_normalized !MINGW '/foo'
invalid_ref_normalized 'heads/foo/../bar'
invalid_ref_normalized 'heads/./foo'
invalid_ref_normalized 'heads\foo'