summaryrefslogtreecommitdiff
path: root/t/t6500-gc.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2019-05-19 07:45:29 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-05-19 07:45:29 (GMT)
commitb20b8fecfb3bc3fc27bc3709aba4e57f5388a62b (patch)
tree5e4e81412b4fa752e42b69ffa85da895698b93c5 /t/t6500-gc.sh
parent7782066f677a016c98ac79fd125b2a8dedd7940f (diff)
parentc871fbee2b7aaa3458f422a6d69a321cbfd9808a (diff)
downloadgit-b20b8fecfb3bc3fc27bc3709aba4e57f5388a62b.zip
git-b20b8fecfb3bc3fc27bc3709aba4e57f5388a62b.tar.gz
git-b20b8fecfb3bc3fc27bc3709aba4e57f5388a62b.tar.bz2
Merge branch 'js/t6500-use-windows-pid-on-mingw'
Future-proof a test against an update to MSYS2 runtime v3.x series. * js/t6500-use-windows-pid-on-mingw: t6500(mingw): use the Windows PID of the shell
Diffstat (limited to 't/t6500-gc.sh')
-rwxr-xr-xt/t6500-gc.sh10
1 files changed, 9 insertions, 1 deletions
diff --git a/t/t6500-gc.sh b/t/t6500-gc.sh
index 7411bf7..515c673 100755
--- a/t/t6500-gc.sh
+++ b/t/t6500-gc.sh
@@ -181,7 +181,15 @@ test_expect_success 'background auto gc respects lock for all operations' '
# now fake a concurrent gc that holds the lock; we can use our
# shell pid so that it looks valid.
hostname=$(hostname || echo unknown) &&
- printf "$$ %s" "$hostname" >.git/gc.pid &&
+ shell_pid=$$ &&
+ if test_have_prereq MINGW && test -f /proc/$shell_pid/winpid
+ then
+ # In Git for Windows, Bash (actually, the MSYS2 runtime) has a
+ # different idea of PIDs than git.exe (actually Windows). Use
+ # the Windows PID in this case.
+ shell_pid=$(cat /proc/$shell_pid/winpid)
+ fi &&
+ printf "%d %s" "$shell_pid" "$hostname" >.git/gc.pid &&
# our gc should exit zero without doing anything
run_and_wait_for_auto_gc &&