X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=t%2Ft5550-http-fetch.sh;h=a1883ca6b649a236e5e08a5e4b76d1479353dcac;hb=6cdf0223fe4a9ccae543fece8b5e78a626ccdf89;hp=2fb48d09edb47129d9cea8b9686e46a6d8f35615;hpb=6a7f71d376becc1a5b0357b682dd0c20842104b0;p=git.git diff --git a/t/t5550-http-fetch.sh b/t/t5550-http-fetch.sh index 2fb48d09e..a1883ca6b 100755 --- a/t/t5550-http-fetch.sh +++ b/t/t5550-http-fetch.sh @@ -30,18 +30,37 @@ test_expect_success 'create http-accessible bare repository' ' ' test_expect_success 'clone http repository' ' - git clone $HTTPD_URL/dumb/repo.git clone && + git clone $HTTPD_URL/dumb/repo.git clone-tmpl && + cp -R clone-tmpl clone && test_cmp file clone/file ' +test_expect_success 'clone http repository with authentication' ' + mkdir "$HTTPD_DOCUMENT_ROOT_PATH/auth/" && + cp -Rf "$HTTPD_DOCUMENT_ROOT_PATH/repo.git" "$HTTPD_DOCUMENT_ROOT_PATH/auth/repo.git" && + git clone $AUTH_HTTPD_URL/auth/repo.git clone-auth && + test_cmp file clone-auth/file +' + test_expect_success 'fetch changes via http' ' echo content >>file && git commit -a -m two && - git push public + git push public && (cd clone && git pull) && test_cmp file clone/file ' +test_expect_success 'fetch changes via manual http-fetch' ' + cp -R clone-tmpl clone2 && + + HEAD=$(git rev-parse --verify HEAD) && + (cd clone2 && + git http-fetch -a -w heads/master-new $HEAD $(git config remote.origin.url) && + git checkout master-new && + test $HEAD = $(git rev-parse --verify HEAD)) && + test_cmp file clone2/file +' + test_expect_success 'http remote detects correct HEAD' ' git push public master:other && (cd clone &&