# Failure in t5516, tests 15 and 16

4 messages from 2007-06-22 to 2007-06-27. Participants: Brian Gernhardt, Junio C Hamano.
Thread: https://gitlist.dev/t/8681

## Brian Gernhardt, 2007-06-22 14:50

Subject: Failure in t5516, tests 15 and 16
Message-ID: <4FAE3A62-A0D1-4C88-8413-88F1D75A2730@silverinsanity.com>
URL: https://gitlist.dev/e/4FAE3A62-A0D1-4C88-8413-88F1D75A2730%40silverinsanity.com

```
Tests 15 and 16 in script "t5516-fetch-push.sh" fails with "notice:  
HEAD points to an unborn branch (master)".  Is this just bad tests or  
an actual failure?  This is with current master  
(45fd8bd32dd68ce6b14a406d0abbd6f56490131c) on OS X.

Detailed test results follow.

~~ Brian

----- 8< -----

* expecting success:

         mk_test &&
         if git show-ref --verify -q refs/tags/frotz
         then
                 git tag -d frotz
         fi &&
         git branch -f frotz master &&
         git push testrepo frotz &&
         check_push_result $the_commit heads/frotz &&
         test "$( cd testrepo && git show-ref | wc -l )" = 1

Initialized empty Git repository in .git/
notice: HEAD points to an unborn branch (master)
notice: No default references
Deleted tag frotz.
updating 'refs/heads/frotz'
   from 0000000000000000000000000000000000000000
   to   9ad36e1e54b2130a20d55abb4f0f3ca8494ead3f
Generating pack...
Done counting 5 objects.
Deltifying 5 objects...
  100% (5/5) done
Writing 5 objects...
  100% (5/5) done
Total 5 (delta 0), reused 0 (delta 0)
Unpacking 5 objects...
  100% (5/5) done
refs/heads/frotz: 0000000000000000000000000000000000000000 ->  
9ad36e1e54b2130a20d55abb4f0f3ca8494ead3f
notice: HEAD points to an unborn branch (master)
* FAIL 15: push with colon-less refspec (3)


                 mk_test &&
                 if git show-ref --verify -q refs/tags/frotz
                 then
                         git tag -d frotz
                 fi &&
                 git branch -f frotz master &&
                 git push testrepo frotz &&
                 check_push_result $the_commit heads/frotz &&
                 test "$( cd testrepo && git show-ref | wc -l )" = 1


* expecting success:

         mk_test &&
         if git show-ref --verify -q refs/heads/frotz
         then
                 git branch -D frotz
         fi &&
         git tag -f frotz &&
         git push testrepo frotz &&
         check_push_result $the_commit tags/frotz &&
         test "$( cd testrepo && git show-ref | wc -l )" = 1


Initialized empty Git repository in .git/
notice: HEAD points to an unborn branch (master)
notice: No default references
Deleted branch frotz.
updating 'refs/tags/frotz'
   from 0000000000000000000000000000000000000000
   to   9ad36e1e54b2130a20d55abb4f0f3ca8494ead3f
Generating pack...
Done counting 5 objects.
Deltifying 5 objects...
  100% (5/5) done
Writing 5 objects...
  100% (5/5) done
Total 5 (delta 0), reused 0 (delta 0)
Unpacking 5 objects...
  100% (5/5) done
refs/tags/frotz: 0000000000000000000000000000000000000000 ->  
9ad36e1e54b2130a20d55abb4f0f3ca8494ead3f
notice: HEAD points to an unborn branch (master)
* FAIL 16: push with colon-less refspec (4)


                 mk_test &&
                 if git show-ref --verify -q refs/heads/frotz
                 then
                         git branch -D frotz
                 fi &&
                 git tag -f frotz &&
                 git push testrepo frotz &&
                 check_push_result $the_commit tags/frotz &&
                 test "$( cd testrepo && git show-ref | wc -l )" = 1



* failed 2 among 16 test(s)

```

## Brian Gernhardt, 2007-06-27 01:29

Subject: Re: Failure in t5516, tests 15 and 16
Message-ID: <CFDE3792-403B-4582-B7FB-BC142B79AE63@silverinsanity.com>
URL: https://gitlist.dev/e/CFDE3792-403B-4582-B7FB-BC142B79AE63%40silverinsanity.com
In-Reply-To: <4FAE3A62-A0D1-4C88-8413-88F1D75A2730@silverinsanity.com>

```

On Jun 22, 2007, at 10:50 AM, Brian Gernhardt wrote:

> Tests 15 and 16 in script "t5516-fetch-push.sh" fails with "notice:  
> HEAD points to an unborn branch (master)".  Is this just bad tests  
> or an actual failure?  This is with current master  
> (45fd8bd32dd68ce6b14a406d0abbd6f56490131c) on OS X.

Okay, I just did used the wonderful "git bisect run" to find out  
where this error started happening.  The answer appears to be in the  
first commit the tests appeared in:  
1ed10b886bc69c129c06772ee4310c00e001657f

I dislike that immensely.  Can anyone help me figure out why the test  
fails?  There is no error message printed.  I thought the "HEAD  
points to an unborn branch" was the error, but that doesn't seem to  
be it.

Again, the test results are below.

~~ Brian

----- 8< -----

* expecting success:

         mk_test &&
         if git show-ref --verify -q refs/tags/frotz
         then
                 git tag -d frotz
         fi &&
         git branch -f frotz master &&
         git push testrepo frotz &&
         check_push_result $the_commit heads/frotz &&
         test "$( cd testrepo && git show-ref | wc -l )" = 1

Initialized empty Git repository in .git/
notice: HEAD points to an unborn branch (master)
notice: No default references
Deleted tag frotz.
updating 'refs/heads/frotz'
   from 0000000000000000000000000000000000000000
   to   9ad36e1e54b2130a20d55abb4f0f3ca8494ead3f
Generating pack...
Done counting 5 objects.
Deltifying 5 objects...
  100% (5/5) done
Writing 5 objects...
  100% (5/5) done
Total 5 (delta 0), reused 0 (delta 0)
Unpacking 5 objects...
  100% (5/5) done
refs/heads/frotz: 0000000000000000000000000000000000000000 ->  
9ad36e1e54b2130a20d55abb4f0f3ca8494ead3f
notice: HEAD points to an unborn branch (master)
* FAIL 15: push with colon-less refspec (3)


                 mk_test &&
                 if git show-ref --verify -q refs/tags/frotz
                 then
                         git tag -d frotz
                 fi &&
                 git branch -f frotz master &&
                 git push testrepo frotz &&
                 check_push_result $the_commit heads/frotz &&
                 test "$( cd testrepo && git show-ref | wc -l )" = 1


* expecting success:

         mk_test &&
         if git show-ref --verify -q refs/heads/frotz
         then
                 git branch -D frotz
         fi &&
         git tag -f frotz &&
         git push testrepo frotz &&
         check_push_result $the_commit tags/frotz &&
         test "$( cd testrepo && git show-ref | wc -l )" = 1


Initialized empty Git repository in .git/
notice: HEAD points to an unborn branch (master)
notice: No default references
Deleted branch frotz.
updating 'refs/tags/frotz'
   from 0000000000000000000000000000000000000000
   to   9ad36e1e54b2130a20d55abb4f0f3ca8494ead3f
Generating pack...
Done counting 5 objects.
Deltifying 5 objects...
  100% (5/5) done
Writing 5 objects...
  100% (5/5) done
Total 5 (delta 0), reused 0 (delta 0)
Unpacking 5 objects...
  100% (5/5) done
refs/tags/frotz: 0000000000000000000000000000000000000000 ->  
9ad36e1e54b2130a20d55abb4f0f3ca8494ead3f
notice: HEAD points to an unborn branch (master)
* FAIL 16: push with colon-less refspec (4)


                 mk_test &&
                 if git show-ref --verify -q refs/heads/frotz
                 then
                         git branch -D frotz
                 fi &&
                 git tag -f frotz &&
                 git push testrepo frotz &&
                 check_push_result $the_commit tags/frotz &&
                 test "$( cd testrepo && git show-ref | wc -l )" = 1



* failed 2 among 16 test(s)

```

## Junio C Hamano, 2007-06-27 01:44

Subject: Re: Failure in t5516, tests 15 and 16
Message-ID: <7v4pkuuq5u.fsf@assigned-by-dhcp.pobox.com>
URL: https://gitlist.dev/e/7v4pkuuq5u.fsf%40assigned-by-dhcp.pobox.com
In-Reply-To: <CFDE3792-403B-4582-B7FB-BC142B79AE63@silverinsanity.com>

```
Brian Gernhardt <benji@silverinsanity.com> writes:

> On Jun 22, 2007, at 10:50 AM, Brian Gernhardt wrote:
>
>> Tests 15 and 16 in script "t5516-fetch-push.sh" fails with "notice:
>> HEAD points to an unborn branch (master)".  Is this just bad tests
>> or an actual failure?  This is with current master
>> (45fd8bd32dd68ce6b14a406d0abbd6f56490131c) on OS X.

Can you check "cd t && sh -x t5516-fetch-push.sh -i -v"?

I am suspecting that

                test "$( cd testrepo && git show-ref | wc -l )" = 1

may have an interesting effect when "wc -l" emits extra
whitespaces.  Does this fix it for you?



diff --git a/t/t5516-fetch-push.sh b/t/t5516-fetch-push.sh
index 08d58e1..c0fa2ba 100755
--- a/t/t5516-fetch-push.sh
+++ b/t/t5516-fetch-push.sh
@@ -226,7 +226,7 @@ test_expect_success 'push with colon-less refspec (3)' '
 	git branch -f frotz master &&
 	git push testrepo frotz &&
 	check_push_result $the_commit heads/frotz &&
-	test "$( cd testrepo && git show-ref | wc -l )" = 1
+	test 1 = $(cd testrepo && git show-ref | wc -l)
 '
 
 test_expect_success 'push with colon-less refspec (4)' '
@@ -239,7 +239,7 @@ test_expect_success 'push with colon-less refspec (4)' '
 	git tag -f frotz &&
 	git push testrepo frotz &&
 	check_push_result $the_commit tags/frotz &&
-	test "$( cd testrepo && git show-ref | wc -l )" = 1
+	test 1 = $(cd testrepo && git show-ref | wc -l)
 
 '
 

```

## Brian Gernhardt, 2007-06-27 01:59

Subject: Re: Failure in t5516, tests 15 and 16
Message-ID: <0EE674FF-3749-43CB-B1CB-7FCF5860D025@silverinsanity.com>
URL: https://gitlist.dev/e/0EE674FF-3749-43CB-B1CB-7FCF5860D025%40silverinsanity.com
In-Reply-To: <7v4pkuuq5u.fsf@assigned-by-dhcp.pobox.com>

```

On Jun 26, 2007, at 9:44 PM, Junio C Hamano wrote:

> Can you check "cd t && sh -x t5516-fetch-push.sh -i -v"?
>
> I am suspecting that
>
>                 test "$( cd testrepo && git show-ref | wc -l )" = 1
>
> may have an interesting effect when "wc -l" emits extra
> whitespaces.  Does this fix it for you?

Exactly right.  This bit me a while back on some other test as well.   
Should have thought of it this time.  Removing the quotes (done  
manually, as it was faster than extracting your patch from the mail)  
fixed it and that test works properly now.  I'm now getting errors in  
some CVS test...  I'll figure that out later, but it appears  
completely unrelated.

I'm beginning to despise several of the OS X utilities.  I wonder if  
this is inherited from some BSD, or if it's all new.  Doesn't matter  
though, if you'd be so kind as to remove those quotes from git.git.  :-)

~~ Brian

```
