3 test_description
='push from/to a shallow clone'
13 test_expect_success
'setup' '
14 git config --global transfer.fsckObjects true &&
26 git clone --no-local --depth=2 .git shallow &&
27 git --git-dir=shallow/.git log --format=%s >actual &&
32 test_cmp expect actual &&
33 git clone --no-local --depth=2 full-abc/.git shallow2 &&
34 git --git-dir=shallow2/.git log --format=%s >actual &&
39 test_cmp expect actual
42 test_expect_success
'push from shallow clone' '
46 git push ../.git +master:refs/remotes/shallow/master
48 git log --format=%s shallow/master >actual &&
57 test_cmp expect actual
60 test_expect_success
'push from shallow clone, with grafted roots' '
63 test_must_fail git push ../.git +master:refs/remotes/shallow2/master 2>err &&
64 grep "shallow2/master.*shallow update not allowed" err
66 test_must_fail git rev-parse shallow2/master &&
70 test_expect_success
'add new shallow root with receive.updateshallow on' '
71 test_config receive.shallowupdate true &&
74 git push ../.git +master:refs/remotes/shallow2/master
76 git log --format=%s shallow2/master >actual &&
82 test_cmp expect actual
85 test_expect_success
'push from shallow to shallow' '
88 git --git-dir=../shallow2/.git config receive.shallowupdate true &&
89 git push ../shallow2/.git +master:refs/remotes/shallow/master &&
90 git --git-dir=../shallow2/.git config receive.shallowupdate false
94 git log --format=%s shallow/master >actual &&
101 test_cmp expect actual
105 test_expect_success
'push from full to shallow' '
106 ! git --git-dir=shallow2/.git cat-file blob `echo 1|git hash-object --stdin` &&
108 git push shallow2/.git +master:refs/remotes/top/master &&
111 git log --format=%s top/master >actual &&
118 test_cmp expect actual &&
119 git cat-file blob `echo 1|git hash-object --stdin` >/dev/null