add basic http clone/fetch tests
[alt-git.git] / t / t5550-http-fetch.sh
blobb6e6ec96075d8e8485de466c4c5c6f325e7b0d62
1 #!/bin/sh
3 test_description='test fetching over http'
4 . ./test-lib.sh
6 if test -n "$NO_CURL"; then
7 say 'skipping test, git built without http support'
8 test_done
9 fi
11 . "$TEST_DIRECTORY"/lib-httpd.sh
12 LIB_HTTPD_PORT=${LIB_HTTPD_PORT-'5550'}
13 start_httpd
15 test_expect_success 'setup repository' '
16 echo content >file &&
17 git add file &&
18 git commit -m one
21 test_expect_success 'create http-accessible bare repository' '
22 mkdir "$HTTPD_DOCUMENT_ROOT_PATH/repo.git" &&
23 (cd "$HTTPD_DOCUMENT_ROOT_PATH/repo.git" &&
24 git --bare init &&
25 echo "exec git update-server-info" >hooks/post-update &&
26 chmod +x hooks/post-update
27 ) &&
28 git remote add public "$HTTPD_DOCUMENT_ROOT_PATH/repo.git" &&
29 git push public master:master
32 test_expect_success 'clone http repository' '
33 git clone $HTTPD_URL/repo.git clone &&
34 test_cmp file clone/file
37 test_expect_success 'fetch changes via http' '
38 echo content >>file &&
39 git commit -a -m two &&
40 git push public
41 (cd clone && git pull) &&
42 test_cmp file clone/file
45 stop_httpd
46 test_done