3 test_description='push from/to a shallow clone over http'
5 GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
6 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
9 . "$TEST_DIRECTORY"/lib-httpd.sh
18 test_expect_success 'setup' '
19 git config --global transfer.fsckObjects true &&
32 git clone --no-local --depth=2 .git shallow &&
33 git --git-dir=shallow/.git log --format=%s >actual &&
38 test_cmp expect actual &&
39 git clone --no-local --depth=2 full-abc/.git shallow2 &&
40 git --git-dir=shallow2/.git log --format=%s >actual &&
45 test_cmp expect actual
48 test_expect_success 'push to shallow repo via http' '
49 git clone --bare --no-local shallow "$HTTPD_DOCUMENT_ROOT_PATH/repo.git" &&
51 cd "$HTTPD_DOCUMENT_ROOT_PATH/repo.git" &&
52 git config http.receivepack true
57 git push $HTTPD_URL/smart/repo.git +main:refs/remotes/top/main
60 cd "$HTTPD_DOCUMENT_ROOT_PATH/repo.git" &&
62 git log --format=%s top/main >actual &&
68 test_cmp expect actual
72 test_expect_success 'push from shallow repo via http' '
73 mv "$HTTPD_DOCUMENT_ROOT_PATH/repo.git" shallow-upstream.git &&
74 git clone --bare --no-local full "$HTTPD_DOCUMENT_ROOT_PATH/repo.git" &&
76 cd "$HTTPD_DOCUMENT_ROOT_PATH/repo.git" &&
77 git config http.receivepack true
80 git push $HTTPD_URL/smart/repo.git +main:refs/remotes/top/main &&
82 cd "$HTTPD_DOCUMENT_ROOT_PATH/repo.git" &&
84 git log --format=%s top/main >actual &&
92 test_cmp expect actual