Skip to content

Commit bccdb48

Browse files
committed
test: Make git-daemon only listen on localhost
No reason to expose a daemon to all interfaces when it is only used for tests, which connect to localhost anyway. I'd love to use localhost here instead, but the git-daemon man page points out: If IPv6 is not supported, then --listen=hostname is also not supported and --listen must be given an IPv4 address. I don't know of a way to check if git has ipv6 support, but 127.0.0.1 should be around for the foreseeable future
1 parent 5fe80b0 commit bccdb48

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

‎git/test/lib/helper.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ def remote_repo_creator(self):
200200
temp_dir = osp(_mktemp())
201201
# On windows, this will fail ... we deal with failures anyway and default to telling the user to do it
202202
try:
203-
gd = Git().daemon(temp_dir, enable='receive-pack', as_process=True)
203+
gd = Git().daemon(temp_dir, enable='receive-pack', listen='127.0.0.1', as_process=True)
204204
# yes, I know ... fortunately, this is always going to work if sleep time is just large enough
205205
time.sleep(0.5)
206206
except Exception:

0 commit comments

Comments
 (0)