]> git.ipfire.org Git - thirdparty/git.git/blobdiff - t/lib-git-daemon.sh
t/lib-git-daemon: record daemon log
[thirdparty/git.git] / t / lib-git-daemon.sh
index 987d40680b4d23f9053c623529eaafa88da04616..9612cccefb1c9dd37e61857a88ea92d86ddf854d 100644 (file)
@@ -53,11 +53,19 @@ start_git_daemon() {
                "$@" "$GIT_DAEMON_DOCUMENT_ROOT_PATH" \
                >&3 2>git_daemon_output &
        GIT_DAEMON_PID=$!
+       >daemon.log
        {
-               read line <&7
-               echo >&4 "$line"
-               cat <&7 >&4 &
-       } 7<git_daemon_output &&
+               read -r line <&7
+               printf "%s\n" "$line"
+               printf >&4 "%s\n" "$line"
+               (
+                       while read -r line <&7
+                       do
+                               printf "%s\n" "$line"
+                               printf >&4 "%s\n" "$line"
+                       done
+               ) &
+       } 7<git_daemon_output >>"$TRASH_DIRECTORY/daemon.log" &&
 
        # Check expected output
        if test x"$(expr "$line" : "\[[0-9]*\] \(.*\)")" != x"Ready to rumble"