Merge branch 'jc/not-mingw-cygwin'
authorJunio C Hamano <gitster@pobox.com>
Tue, 9 Sep 2014 19:53:54 +0000 (12:53 -0700)
committerJunio C Hamano <gitster@pobox.com>
Tue, 9 Sep 2014 19:53:54 +0000 (12:53 -0700)
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

1  2 
t/t1402-check-ref-format.sh
t/test-lib.sh
index 4bc7141226c802ca049a76e978b6196f9e9fd7ff,28e93186ab939103579a9af9e383b12d6e989aed..e5dc62e9efbf9c26bad93c7384f9fb9fa6a970e8
@@@ -7,7 -7,7 +7,7 @@@ test_description='Test git check-ref-fo
  valid_ref() {
        prereq=
        case $1 in
-       [A-Z]*)
+       [A-Z!]*)
                prereq=$1
                shift
        esac
@@@ -19,7 -19,7 +19,7 @@@
  invalid_ref() {
        prereq=
        case $1 in
-       [A-Z]*)
+       [A-Z!]*)
                prereq=$1
                shift
        esac
  }
  
  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'
@@@ -48,7 -48,6 +48,7 @@@ invalid_ref './foo/bar
  invalid_ref 'foo/./bar'
  invalid_ref 'foo/bar/.'
  invalid_ref '.refs/foo'
 +invalid_ref 'refs/heads/foo.'
  invalid_ref 'heads/foo..bar'
  invalid_ref 'heads/foo?bar'
  valid_ref 'foo./bar'
@@@ -65,6 -64,7 +65,6 @@@ valid_ref "$(printf 'heads/fu\303\237')
  invalid_ref 'heads/*foo/bar' --refspec-pattern
  invalid_ref 'heads/foo*/bar' --refspec-pattern
  invalid_ref 'heads/f*o/bar' --refspec-pattern
 -invalid_ref 'heads/foo*//bar' --refspec-pattern
  
  ref='foo'
  invalid_ref "$ref"
@@@ -120,15 -120,29 +120,15 @@@ invalid_ref "$ref" --refspec-patter
  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'
  
 -
 -valid_ref 'refs/heads/a-very-long-refname'
 -invalid_ref 'refs/heads/.a-very-long-refname'
 -invalid_ref 'refs/heads/abcdefgh0123..'
 -invalid_ref 'refs/heads/abcdefgh01234..'
 -invalid_ref 'refs/heads/abcdefgh012345..'
 -invalid_ref 'refs/heads/abcdefgh0123456..'
 -invalid_ref 'refs/heads/abcdefgh01234567..'
 -valid_ref 'refs/heads/abcdefgh0123.a'
 -valid_ref 'refs/heads/abcdefgh01234.a'
 -valid_ref 'refs/heads/abcdefgh012345.a'
 -valid_ref 'refs/heads/abcdefgh0123456.a'
 -valid_ref 'refs/heads/abcdefgh01234567.a'
 -
  test_expect_success "check-ref-format --branch @{-1}" '
        T=$(git write-tree) &&
        sha1=$(echo A | git commit-tree $T) &&
@@@ -162,7 -176,7 +162,7 @@@ test_expect_success 'check-ref-format -
  valid_ref_normalized() {
        prereq=
        case $1 in
-       [A-Z]*)
+       [A-Z!]*)
                prereq=$1
                shift
        esac
  invalid_ref_normalized() {
        prereq=
        case $1 in
-       [A-Z]*)
+       [A-Z!]*)
                prereq=$1
                shift
        esac
  
  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'
diff --combined t/test-lib.sh
index b1bc65bfb564ca85d35c42071f825360d1998392,b72f6bd414b48f8cbeaf8ac8cd3109e9e9f93ad3..2b525a8e1d19cd11fea0ba06372111306ce7bf41
@@@ -109,10 -109,6 +109,10 @@@ export GIT_AUTHOR_EMAIL GIT_AUTHOR_NAM
  export GIT_COMMITTER_EMAIL GIT_COMMITTER_NAME
  export EDITOR
  
 +# Tests using GIT_TRACE typically don't want <timestamp> <file>:<line> output
 +GIT_TRACE_BARE=1
 +export GIT_TRACE_BARE
 +
  if test -n "${TEST_GIT_INDEX_VERSION:+isset}"
  then
        GIT_INDEX_VERSION="$TEST_GIT_INDEX_VERSION"
@@@ -870,7 -866,6 +870,6 @@@ case $(uname -s) i
        # backslashes in pathspec are converted to '/'
        # exec does not inherit the PID
        test_set_prereq MINGW
-       test_set_prereq NOT_CYGWIN
        test_set_prereq SED_STRIPS_CR
        test_set_prereq GREP_STRIPS_CR
        GIT_TEST_CMP=mingw_test_cmp
  *CYGWIN*)
        test_set_prereq POSIXPERM
        test_set_prereq EXECKEEPSPID
-       test_set_prereq NOT_MINGW
        test_set_prereq CYGWIN
        test_set_prereq SED_STRIPS_CR
        test_set_prereq GREP_STRIPS_CR
        test_set_prereq POSIXPERM
        test_set_prereq BSLASHPSPEC
        test_set_prereq EXECKEEPSPID
-       test_set_prereq NOT_MINGW
-       test_set_prereq NOT_CYGWIN
        ;;
  esac