diff options
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2013-12-05 14:02:48 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2013-12-11 01:14:18 +0100 |
commit | b016918b2f283513758957b06a14eb2f5c2a9619 (patch) | |
tree | 3f24fe80042ec67470e6b64f4f6db374866395bc /t/t5538-push-shallow.sh | |
parent | receive-pack: allow pushes that update .git/shallow (diff) | |
download | git-b016918b2f283513758957b06a14eb2f5c2a9619.tar.xz git-b016918b2f283513758957b06a14eb2f5c2a9619.zip |
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/t5538-push-shallow.sh')
-rwxr-xr-x | t/t5538-push-shallow.sh | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/t/t5538-push-shallow.sh b/t/t5538-push-shallow.sh index ff5eb5bcf5..f5c74e6b34 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 |