summaryrefslogtreecommitdiff
path: root/t/t5537-fetch-shallow.sh
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2013-12-05 20:02:41 +0700
committerJunio C Hamano <gitster@pobox.com>2013-12-10 16:14:17 -0800
commit79d3a236c551ad59719a6835bee03a1446296e65 (patch)
treea23554e47b3d83df429dda8e9fbe7c33a1b8cb58 /t/t5537-fetch-shallow.sh
parent4820a33baa963c4559736d7a1c4c35f8dcb37293 (diff)
downloadgit-79d3a236c551ad59719a6835bee03a1446296e65.tar.gz
upload-pack: make sure deepening preserves shallow roots
When "fetch --depth=N" where N exceeds the longest chain of history in the source repo, usually we just send an "unshallow" line to the client so full history is obtained. When the source repo is shallow we need to make sure to "unshallow" the current shallow point _and_ "shallow" again when the commit reaches its shallow bottom in the source repo. This should fix both cases: large <N> and --unshallow. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t5537-fetch-shallow.sh')
-rwxr-xr-xt/t5537-fetch-shallow.sh16
1 files changed, 16 insertions, 0 deletions
diff --git a/t/t5537-fetch-shallow.sh b/t/t5537-fetch-shallow.sh
index d2110527ef..022cb2c990 100755
--- a/t/t5537-fetch-shallow.sh
+++ b/t/t5537-fetch-shallow.sh
@@ -79,6 +79,22 @@ EOF
)
'
+test_expect_success 'fetch --unshallow from shallow clone' '
+ (
+ cd shallow2 &&
+ git fetch --unshallow &&
+ git fsck &&
+ git log --format=%s origin/master >actual &&
+ cat <<EOF >expect &&
+6
+5
+4
+3
+EOF
+ test_cmp expect actual
+ )
+'
+
test_expect_success 'fetch something upstream has but hidden by clients shallow boundaries' '
# the blob "1" is available in .git but hidden by the
# shallow2/.git/shallow and it should be resent