Skip to content

Commit 415ee61

Browse files
committed
azure-pipelines: make gitdaemon tests work on Win32
On Win32 builds, the PID file created by git-daemon contained in invalid PID that we were not able to kill afterwards. Somehow, it seems like the contained PID was wrapped in braces. Consequentially, kill(1) failed and thus caused the build to error. Fix this by directly grabbing the PID of the spawned git-daemon process.
1 parent f867bfa commit 415ee61

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

azure-pipelines/test.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ SUCCESS=1
1616
cleanup() {
1717
echo "Cleaning up..."
1818

19-
if [ ! -z "$GITDAEMON_DIR" -a -f "${GITDAEMON_DIR}/pid" ]; then
19+
if [ ! -z "$GITDAEMON_PID" ]; then
2020
echo "Stopping git daemon..."
21-
kill $(cat "${GITDAEMON_DIR}/pid")
21+
kill $GITDAEMON_PID
2222
fi
2323

2424
if [ ! -z "$SSHD_DIR" -a -f "${SSHD_DIR}/pid" ]; then
@@ -73,7 +73,8 @@ if [ -z "$SKIP_GITDAEMON_TESTS" ]; then
7373
echo "Starting git daemon..."
7474
GITDAEMON_DIR=`mktemp -d ${TMPDIR}/gitdaemon.XXXXXXXX`
7575
git init --bare "${GITDAEMON_DIR}/test.git"
76-
git daemon --listen=localhost --export-all --enable=receive-pack --pid-file="${GITDAEMON_DIR}/pid" --base-path="${GITDAEMON_DIR}" "${GITDAEMON_DIR}" 2>/dev/null &
76+
git daemon --listen=localhost --export-all --enable=receive-pack --base-path="${GITDAEMON_DIR}" "${GITDAEMON_DIR}" 2>/dev/null &
77+
GITDAEMON_PID=$!
7778
fi
7879

7980
if [ -z "$SKIP_PROXY_TESTS" ]; then

0 commit comments

Comments
 (0)