Skip to content

Commit 387a106

Browse files
committed
Have git-daemon use IPv6
1 parent 4d2e25c commit 387a106

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

tests/helpers.sh

+5-4
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,11 @@ function small-repo-in-sandbox() {
6161

6262
function launch-git-daemon() {
6363
local port=9418
64-
if nc -4z localhost "$port"; then
64+
if nc -z 127.0.0.1 "$port"; then
6565
echo "Port $port (IPv4) should not have been open before this test's run of the git daemon!" >&2
6666
return 1
6767
fi
68-
if nc -6z localhost "$port"; then
68+
if nc -z ::1 "$port"; then
6969
echo "Port $port (IPv6) should not have been open before this test's run of the git daemon!" >&2
7070
return 1
7171
fi
@@ -74,9 +74,10 @@ function launch-git-daemon() {
7474
echo 'An instance of git-daemon seems to be running already!' >&2
7575
return 1
7676
fi
77-
git -c uploadpack.allowRefInWant=true daemon --verbose --base-path=. --export-all --user-path &>/dev/null &
77+
git -c uploadpack.allowRefInWant=true \
78+
daemon --verbose --base-path=. --export-all --user-path --listen=::1 &>/dev/null &
7879
daemon_pid=$!
79-
while ! nc -z localhost "$port"; do
80+
while ! nc -z ::1 "$port"; do
8081
sleep 0.1
8182
done
8283
trap 'kill $daemon_pid' EXIT

0 commit comments

Comments
 (0)