summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTay Ray Chuan <rctay89@gmail.com>2010-11-25 08:21:03 (GMT)
committerJunio C Hamano <gitster@pobox.com>2010-11-26 22:50:45 (GMT)
commit6cfc028641246939ee52a6720d4d3c4b63ccb515 (patch)
tree8553f7491a1e084440ee4381d23c11bb40420e4e
parent2bcd9ec5018ad259e5b6803dccf0c7bc121bd9ea (diff)
downloadgit-6cfc028641246939ee52a6720d4d3c4b63ccb515.zip
git-6cfc028641246939ee52a6720d4d3c4b63ccb515.tar.gz
git-6cfc028641246939ee52a6720d4d3c4b63ccb515.tar.bz2
t5550-http-fetch: add test for http-fetch
Signed-off-by: Tay Ray Chuan <rctay89@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rwxr-xr-xt/t5550-http-fetch.sh14
1 files changed, 13 insertions, 1 deletions
diff --git a/t/t5550-http-fetch.sh b/t/t5550-http-fetch.sh
index 39f7b7c..d3bf5ce 100755
--- a/t/t5550-http-fetch.sh
+++ b/t/t5550-http-fetch.sh
@@ -30,7 +30,8 @@ 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
'
@@ -42,6 +43,17 @@ test_expect_success 'fetch changes via http' '
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 &&