Skip to content

Commit 4aa197b

Browse files
committed
Run the git-daemon executable directly
So `$!` gives the PID of the daemon itself, in case that helps. This also no longer displays `GIT_CONFIG_*` vars, which was just to check that the inflexible hard-coding way used here is okay at least for initial testing of this change.
1 parent 9686a09 commit 4aa197b

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

tests/helpers.sh

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -60,18 +60,15 @@ function small-repo-in-sandbox() {
6060
}
6161

6262
function launch-git-daemon() {
63-
local port=9418
63+
local port=9418 exec_path
6464
if nc -z localhost "$port"; then
6565
echo "Port $port should not have been open before this test's run of the git daemon!" >&2
6666
return 1
6767
fi
68-
(
69-
set +e -x
70-
echo 'GIT_CONFIG_* vars START'
71-
printenv | grep ^GIT_CONFIG_
72-
echo 'GIT_CONFIG_* vars END'
73-
) >&2
74-
git -c uploadpack.allowRefInWant=true daemon --verbose --base-path=. --export-all --user-path &>/dev/null &
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 &
7572
daemon_pid=$!
7673
while ! nc -z localhost "$port"; do
7774
sleep 0.1

0 commit comments

Comments
 (0)