Merge branch 'nd/clone-connectivity-shortcut' (early part) into maint
authorJunio C Hamano <gitster@pobox.com>
Fri, 28 Jun 2013 17:00:00 +0000 (10:00 -0700)
committerJunio C Hamano <gitster@pobox.com>
Fri, 28 Jun 2013 17:00:00 +0000 (10:00 -0700)
Cloning with "git clone --depth N" while fetch.fsckobjects (or
transfer.fsckobjects) is set to true did not tell the cut-off points
of the shallow history to the process that validates the objects and
the history received, causing the validation to fail.

* 'nd/clone-connectivity-shortcut' (early part):
fetch-pack: prepare updated shallow file before fetching the pack
clone: let the user know when check_everything_connected is run

1  2 
t/t5500-fetch-pack.sh
diff --combined t/t5500-fetch-pack.sh
index 6133d9ed13804d1cda4044e906ada1065fbad4a6,557b073b36248522445b6bd7343b4af16b9a7611..fd2598e60190fe04381652c7dfe997e01b4ea0c5
@@@ -135,6 -135,13 +135,13 @@@ test_expect_success 'clone shallow dept
        test "`git --git-dir=shallow0/.git rev-list --count HEAD`" = 1
  '
  
+ test_expect_success 'clone shallow depth 1 with fsck' '
+       git config --global fetch.fsckobjects true &&
+       git clone --no-single-branch --depth 1 "file://$(pwd)/." shallow0fsck &&
+       test "`git --git-dir=shallow0fsck/.git rev-list --count HEAD`" = 1 &&
+       git config --global --unset fetch.fsckobjects
+ '
  test_expect_success 'clone shallow' '
        git clone --no-single-branch --depth 2 "file://$(pwd)/." shallow
  '
@@@ -373,20 -380,6 +380,20 @@@ test_expect_success 'clone shallow wit
        test_cmp count8.expected count8.actual
  '
  
 +test_expect_success 'fetch in shallow repo unreachable shallow objects' '
 +      (
 +              git clone --bare --branch B --single-branch "file://$(pwd)/." no-reflog &&
 +              git clone --depth 1 "file://$(pwd)/no-reflog" shallow9 &&
 +              cd no-reflog &&
 +              git tag -d TAGB1 TAGB2 &&
 +              git update-ref refs/heads/B B~~ &&
 +              git gc --prune=now &&
 +              cd ../shallow9 &&
 +              git fetch origin &&
 +              git fsck --no-dangling
 +      )
 +'
 +
  test_expect_success 'setup tests for the --stdin parameter' '
        for head in C D E F
        do