aboutsummaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2013-12-05 20:02:48 +0700
committerJunio C Hamano <gitster@pobox.com>2013-12-10 16:14:18 -0800
commitb016918b2f283513758957b06a14eb2f5c2a9619 (patch)
tree3f24fe80042ec67470e6b64f4f6db374866395bc /t
parent0a1bc12b6e401825f009ac8bb14fc438f77e2d9f (diff)
downloadgit-b016918b2f283513758957b06a14eb2f5c2a9619.tar.gz
git-b016918b2f283513758957b06a14eb2f5c2a9619.tar.xz
send-pack: support pushing to a shallow clone
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')
-rwxr-xr-xt/t5538-push-shallow.sh38
1 files changed, 38 insertions, 0 deletions
diff --git a/t/t5538-push-shallow.sh b/t/t5538-push-shallow.sh
index ff5eb5bcf..f5c74e6b3 100755
--- a/t/t5538-push-shallow.sh
+++ b/t/t5538-push-shallow.sh
@@ -82,4 +82,42 @@ EOF
test_cmp expect actual
'
+test_expect_success 'push from shallow to shallow' '
+ (
+ cd shallow &&
+ git --git-dir=../shallow2/.git config receive.shallowupdate true &&
+ git push ../shallow2/.git +master:refs/remotes/shallow/master &&
+ git --git-dir=../shallow2/.git config receive.shallowupdate false
+ ) &&
+ (
+ cd shallow2 &&
+ git log --format=%s shallow/master >actual &&
+ git fsck &&
+ cat <<EOF >expect &&
+5
+4
+3
+EOF
+ test_cmp expect actual
+ )
+'
+
+test_expect_success 'push from full to shallow' '
+ ! git --git-dir=shallow2/.git cat-file blob `echo 1|git hash-object --stdin` &&
+ commit 1 &&
+ git push shallow2/.git +master:refs/remotes/top/master &&
+ (
+ cd shallow2 &&
+ git log --format=%s top/master >actual &&
+ git fsck &&
+ cat <<EOF >expect &&
+1
+4
+3
+EOF
+ test_cmp expect actual &&
+ git cat-file blob `echo 1|git hash-object --stdin` >/dev/null
+ )
+'
+
test_done