diff options
author | Nicolas Pitre <nico@cam.org> | 2009-08-24 00:04:09 -0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2009-08-24 15:03:56 -0700 |
commit | 86386829d425a3d3ae6ce713c58328607e50e523 (patch) | |
tree | c35215adc859d0f68f854fa10debf2e1ebd63e78 /t/t5500-fetch-pack.sh | |
parent | 57f6ec029090f64377ec5c0926b6e2e39b0caa4f (diff) | |
download | git-86386829d425a3d3ae6ce713c58328607e50e523.tar.gz |
fix simple deepening of a repo
If all refs sent by the remote repo during a fetch are reachable
locally, then no further conversation is performed with the remote. This
check is skipped when the --depth argument is provided to allow the
deepening of a shallow clone which corresponding remote repo has no
changed.
However, some additional filtering was added in commit c29727d5 to
remove those refs which are equal on both sides. If the remote repo has
not changed, then the list of refs to give the remote process becomes
empty and simply attempting to deepen a shallow repo always fails.
Let's stop being smart in that case and simply send the whole list over
when that condition is met. The remote will do the right thing anyways.
Test cases for this issue are also provided.
Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t5500-fetch-pack.sh')
-rwxr-xr-x | t/t5500-fetch-pack.sh | 47 |
1 files changed, 46 insertions, 1 deletions
diff --git a/t/t5500-fetch-pack.sh b/t/t5500-fetch-pack.sh index c450f33f33..ea5a4ed3b2 100755 --- a/t/t5500-fetch-pack.sh +++ b/t/t5500-fetch-pack.sh @@ -147,7 +147,35 @@ test_expect_success "clone shallow object count (part 2)" ' test_expect_success "fsck in shallow repo" \ "(cd shallow; git fsck --full)" -#test_done; exit +test_expect_success 'simple fetch in shallow repo' ' + ( + cd shallow && + git fetch + ) +' + +test_expect_success 'no changes expected' ' + ( + cd shallow && + git count-objects -v + ) > count.shallow.2 && + cmp count.shallow count.shallow.2 +' + +test_expect_success 'fetch same depth in shallow repo' ' + ( + cd shallow && + git fetch --depth=2 + ) +' + +test_expect_success 'no changes expected' ' + ( + cd shallow && + git count-objects -v + ) > count.shallow.3 && + cmp count.shallow count.shallow.3 +' add B66 $B65 add B67 $B66 @@ -179,4 +207,21 @@ test_expect_success "clone shallow object count" \ test_expect_success "pull in shallow repo with missing merge base" \ "(cd shallow && test_must_fail git pull --depth 4 .. A)" +test_expect_success 'additional simple shallow deepenings' ' + ( + cd shallow && + git fetch --depth=8 && + git fetch --depth=10 && + git fetch --depth=11 + ) +' + +test_expect_success 'clone shallow object count' ' + ( + cd shallow && + git count-objects -v + ) > count.shallow && + grep "^count: 52" count.shallow +' + test_done |