Skip to content

Commit a75aba4

Browse files
committed
Merge branch 'js/daemon-test-race-fix'
The shell construct to launch git-daemon and wait for it to start serving during the test was faulty, and this fixes it. By Johannes Sixt * js/daemon-test-race-fix: t5570: fix forwarding of git-daemon messages via cat
2 parents 55375e9 + 46e3581 commit a75aba4

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

t/lib-git-daemon.sh

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -31,19 +31,19 @@ start_git_daemon() {
3131
>&3 2>git_daemon_output &
3232
GIT_DAEMON_PID=$!
3333
{
34-
read line
34+
read line <&7
3535
echo >&4 "$line"
36-
cat >&4 &
36+
cat <&7 >&4 &
37+
} 7<git_daemon_output &&
3738

38-
# Check expected output
39-
if test x"$(expr "$line" : "\[[0-9]*\] \(.*\)")" != x"Ready to rumble"
40-
then
41-
kill "$GIT_DAEMON_PID"
42-
wait "$GIT_DAEMON_PID"
43-
trap 'die' EXIT
44-
error "git daemon failed to start"
45-
fi
46-
} <git_daemon_output
39+
# Check expected output
40+
if test x"$(expr "$line" : "\[[0-9]*\] \(.*\)")" != x"Ready to rumble"
41+
then
42+
kill "$GIT_DAEMON_PID"
43+
wait "$GIT_DAEMON_PID"
44+
trap 'die' EXIT
45+
error "git daemon failed to start"
46+
fi
4747
}
4848

4949
stop_git_daemon() {

0 commit comments

Comments
 (0)