File tree 1 file changed +7
-5
lines changed
1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -60,15 +60,17 @@ function small-repo-in-sandbox() {
60
60
}
61
61
62
62
function launch-git-daemon() {
63
- local port=9418 exec_path
63
+ local port=9418
64
64
if nc -z localhost " $port " ; then
65
65
echo " Port $port should not have been open before this test's run of the git daemon!" >&2
66
66
return 1
67
67
fi
68
- exec_path=" $( git --exec-path) "
69
- # TODO: Maybe dynamically set the `GIT_CONFIG_*` vars, to accommodate preexisting ones.
70
- GIT_CONFIG_COUNT=1 GIT_CONFIG_KEY_0=uploadpack.allowRefInWant GIT_CONFIG_VALUE_0=true \
71
- " $exec_path /git-daemon" --verbose --base-path=. --export-all --user-path & > /dev/null &
68
+ if pgrep git-daemon; then
69
+ # TODO: This may be over-broad, as we only need port 9418 (on whatever of 127.0.0.1 and ::1 exist).
70
+ echo ' An instance of git-daemon seems to be running already!' >&2
71
+ return 1
72
+ fi
73
+ git -c uploadpack.allowRefInWant=true daemon --verbose --base-path=. --export-all --user-path & > /dev/null &
72
74
daemon_pid=$!
73
75
while ! nc -z localhost " $port " ; do
74
76
sleep 0.1
You can’t perform that action at this time.
0 commit comments