@matheusbsbs / matheus-bagliano / commits / 6cfc028641
Fork 0

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>

Tay Ray Chuan committed Nov 25, 2010 at 16:21 UTC 6cfc028641246939ee52a6720d4d3c4b63ccb515
1 file changed +13 -1
t/t5550-http-fetch.sh
+13 -1
@@ -30,7 +30,8 @@ test_expect_success 'create http-accessible bare repository' '
30 '
31
32 test_expect_success 'clone http repository' '
33 - git clone $HTTPD_URL/dumb/repo.git clone &&
33 + git clone $HTTPD_URL/dumb/repo.git clone-tmpl &&
34 + cp -R clone-tmpl clone &&
35 test_cmp file clone/file
36 '
37
@@ -42,6 +43,17 @@ test_expect_success 'fetch changes via http' '
43 test_cmp file clone/file
44 '
45
46 +test_expect_success 'fetch changes via manual http-fetch' '
47 + cp -R clone-tmpl clone2 &&
48 +
49 + HEAD=$(git rev-parse --verify HEAD) &&
50 + (cd clone2 &&
51 + git http-fetch -a -w heads/master-new $HEAD $(git config remote.origin.url) &&
52 + git checkout master-new &&
53 + test $HEAD = $(git rev-parse --verify HEAD)) &&
54 + test_cmp file clone2/file
55 +'
56 +
57 test_expect_success 'http remote detects correct HEAD' '
58 git push public master:other &&
59 (cd clone &&