Merge branch 'maint-1.6.0' into maint-1.6.1
authorJunio C Hamano <gitster@pobox.com>
Sat, 8 Aug 2009 03:44:02 +0000 (20:44 -0700)
committerJunio C Hamano <gitster@pobox.com>
Sat, 8 Aug 2009 03:44:02 +0000 (20:44 -0700)
* maint-1.6.0:
verify-pack -v: do not report "chain length 0"
t5510: harden the way verify-pack is used

1  2 
t/t5510-fetch.sh
diff --combined t/t5510-fetch.sh
index 9e679b402dc826185377c431d353decd8a8a2bed,61a02a91a198d9150cec0692c57c1b5d1a576cf5..b2e6e96b3f928c5ca66589e4e24f28eeeaf176c5
@@@ -9,6 -9,11 +9,11 @@@ test_description='Per branch config var
  
  D=`pwd`
  
+ test_bundle_object_count () {
+       git verify-pack -v "$1" >verify.out &&
+       test "$2" = $(grep '^[0-9a-f]\{40\} ' verify.out | wc -l)
+ }
  test_expect_success setup '
        echo >file original &&
        git add file &&
@@@ -146,6 -151,7 +151,7 @@@ test_expect_success 'unbundle 1' 
        test_must_fail git fetch "$D/bundle1" master:master
  '
  
  test_expect_success 'bundle 1 has only 3 files ' '
        cd "$D" &&
        (
                cat
        ) <bundle1 >bundle.pack &&
        git index-pack bundle.pack &&
-       verify=$(git verify-pack -v bundle.pack) &&
-       test 4 = $(echo "$verify" | wc -l)
+       test_bundle_object_count bundle.pack 3
  '
  
  test_expect_success 'unbundle 2' '
@@@ -180,7 -185,7 +185,7 @@@ test_expect_success 'bundle does not pr
                cat
        ) <bundle3 >bundle.pack &&
        git index-pack bundle.pack &&
-       test 4 = $(git verify-pack -v bundle.pack | wc -l)
+       test_bundle_object_count bundle.pack 3
  '
  
  test_expect_success 'bundle should be able to create a full history' '
@@@ -303,26 -308,6 +308,26 @@@ test_expect_success 'pushing nonexisten
  
  '
  
 +test_expect_success 'auto tag following fetches minimum' '
 +
 +      cd "$D" &&
 +      git clone .git follow &&
 +      git checkout HEAD^0 &&
 +      (
 +              for i in 1 2 3 4 5 6 7
 +              do
 +                      echo $i >>file &&
 +                      git commit -m $i -a &&
 +                      git tag -a -m $i excess-$i || exit 1
 +              done
 +      ) &&
 +      git checkout master &&
 +      (
 +              cd follow &&
 +              git fetch
 +      )
 +'
 +
  test_expect_success 'refuse to fetch into the current branch' '
  
        test_must_fail git fetch . side:master