summaryrefslogtreecommitdiff
path: root/t/t6500-gc.sh
diff options
context:
space:
mode:
authorLibravatar Jiang Xin <worldhello.net@gmail.com>2019-05-31 14:34:26 +0800
committerLibravatar Jiang Xin <worldhello.net@gmail.com>2019-05-31 14:34:26 +0800
commita17177ce3ac74afc0b2e6fc6c80c1e1991b96a13 (patch)
tree0ff1a62d28a13bc8d8708148b85d3b0ba2632f92 /t/t6500-gc.sh
parentMerge branch 'master' of https://github.com/Softcatala/git-po (diff)
parentGit 2.22-rc2 (diff)
downloadtgif-a17177ce3ac74afc0b2e6fc6c80c1e1991b96a13.tar.xz
Merge branch 'master' of git://git.kernel.org/pub/scm/git/git
* 'master' of git://git.kernel.org/pub/scm/git/git: (66 commits) Git 2.22-rc2 ...
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 7411bf7fec..515c6735e9 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 &&