aboutsummaryrefslogtreecommitdiff
path: root/t/t5538-push-shallow.sh
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2013-12-05 20:02:51 +0700
committerJunio C Hamano <gitster@pobox.com>2013-12-10 16:14:18 -0800
commitc29a7b8b3f71c1bede1f57626bafe120280aaea3 (patch)
treeea8bc978f0929c3cc0c16a80b0feb9191979f2ec /t/t5538-push-shallow.sh
parent16094885ca94f72abc28a915f9aa4021e203a16d (diff)
downloadgit-c29a7b8b3f71c1bede1f57626bafe120280aaea3.tar.gz
git-c29a7b8b3f71c1bede1f57626bafe120280aaea3.tar.xz
receive-pack: support pushing to a shallow clone via http
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-xt/t5538-push-shallow.sh35
1 files changed, 35 insertions, 0 deletions
diff --git a/t/t5538-push-shallow.sh b/t/t5538-push-shallow.sh
index f5c74e6b3..866621a74 100755
--- a/t/t5538-push-shallow.sh
+++ b/t/t5538-push-shallow.sh
@@ -16,6 +16,7 @@ test_expect_success 'setup' '
commit 2 &&
commit 3 &&
commit 4 &&
+ git clone . full &&
(
git init full-abc &&
cd full-abc &&
@@ -120,4 +121,38 @@ EOF
)
'
+if test -n "$NO_CURL" -o -z "$GIT_TEST_HTTPD"; then
+ say 'skipping remaining tests, git built without http support'
+ test_done
+fi
+
+LIB_HTTPD_PORT=${LIB_HTTPD_PORT-'5537'}
+. "$TEST_DIRECTORY"/lib-httpd.sh
+start_httpd
+
+test_expect_success 'push to shallow repo via http' '
+ git clone --bare --no-local shallow "$HTTPD_DOCUMENT_ROOT_PATH/repo.git" &&
+ (
+ cd "$HTTPD_DOCUMENT_ROOT_PATH/repo.git" &&
+ git config http.receivepack true
+ ) &&
+ (
+ cd full &&
+ commit 9 &&
+ git push $HTTPD_URL/smart/repo.git +master:refs/remotes/top/master
+ ) &&
+ (
+ cd "$HTTPD_DOCUMENT_ROOT_PATH/repo.git" &&
+ git fsck &&
+ git log --format=%s top/master >actual &&
+ cat <<EOF >expect &&
+9
+4
+3
+EOF
+ test_cmp expect actual
+ )
+'
+
+stop_httpd
test_done