3 test_description
='git daemon and cloning via git:// protocol'
6 test -z "$GIT_DAEMON_TEST_PORT" && {
7 say
"Skipping git-daemon tests."
8 say
"Set GIT_DAEMON_TEST_PORT to a port if you want to test it."
13 test_expect_success
'setup' '
18 echo biomimicry > ted &&
21 git commit -m initial &&
26 PORT
=$GIT_DAEMON_TEST_PORT
29 echo "kill $DAEMON_PID"
35 git daemon
--base-path="$(pwd)" \
40 DAEMON_PID
=$
(cat pid-file
)
43 test_expect_success
'daemon' '
50 test_expect_success
'clone fails without export-ok' '
52 ! git clone git://127.0.0.1:"$PORT"/first second
56 test_expect_success
'clone succeeds with export-ok' '
58 : > first/.git/git-daemon-export-ok &&
59 git clone git://127.0.0.1:"$PORT"/first second &&
60 for f in refs/heads/master objects/pack/*.pack
62 cmp first/.git/$f second/.git/$f || break
67 test_expect_success
'stop daemon' stop_daemon