X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=t%2Ft5541-http-push.sh;h=6c9ec6f1171ab39c115230a4b6bb6be3780577c9;hb=a734e7ef6c14d8eb476fe8b2d6f861b3ed2c211d;hp=a73c82635ff6fba6fcef4f139ff09205c1b9b6de;hpb=7fa6c90c72fb8dc8277d7cae759d5036046a5164;p=git.git diff --git a/t/t5541-http-push.sh b/t/t5541-http-push.sh index a73c82635..6c9ec6f11 100755 --- a/t/t5541-http-push.sh +++ b/t/t5541-http-push.sh @@ -14,6 +14,7 @@ fi ROOT_PATH="$PWD" LIB_HTTPD_PORT=${LIB_HTTPD_PORT-'5541'} . "$TEST_DIRECTORY"/lib-httpd.sh +. "$TEST_DIRECTORY"/lib-terminal.sh start_httpd test_expect_success 'setup remote repository' ' @@ -154,5 +155,44 @@ test_expect_success 'push (chunked)' ' test $HEAD = $(git rev-parse --verify HEAD)) ' +test_expect_success 'push --all can push to empty repo' ' + d=$HTTPD_DOCUMENT_ROOT_PATH/empty-all.git && + git init --bare "$d" && + git --git-dir="$d" config http.receivepack true && + git push --all "$HTTPD_URL"/smart/empty-all.git +' + +test_expect_success 'push --mirror can push to empty repo' ' + d=$HTTPD_DOCUMENT_ROOT_PATH/empty-mirror.git && + git init --bare "$d" && + git --git-dir="$d" config http.receivepack true && + git push --mirror "$HTTPD_URL"/smart/empty-mirror.git +' + +test_expect_success 'push --all to repo with alternates' ' + s=$HTTPD_DOCUMENT_ROOT_PATH/test_repo.git && + d=$HTTPD_DOCUMENT_ROOT_PATH/alternates-all.git && + git clone --bare --shared "$s" "$d" && + git --git-dir="$d" config http.receivepack true && + git --git-dir="$d" repack -adl && + git push --all "$HTTPD_URL"/smart/alternates-all.git +' + +test_expect_success 'push --mirror to repo with alternates' ' + s=$HTTPD_DOCUMENT_ROOT_PATH/test_repo.git && + d=$HTTPD_DOCUMENT_ROOT_PATH/alternates-mirror.git && + git clone --bare --shared "$s" "$d" && + git --git-dir="$d" config http.receivepack true && + git --git-dir="$d" repack -adl && + git push --mirror "$HTTPD_URL"/smart/alternates-mirror.git +' + +test_expect_success TTY 'quiet push' ' + cd "$ROOT_PATH"/test_repo_clone && + test_commit quiet && + test_terminal git push --quiet --no-progress 2>&1 | tee output && + test_cmp /dev/null output +' + stop_httpd test_done