File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -162,7 +162,15 @@ test_expect_success 'background auto gc respects lock for all operations' '
162162 # now fake a concurrent gc that holds the lock; we can use our
163163 # shell pid so that it looks valid.
164164 hostname=$(hostname || echo unknown) &&
165- printf "$$ %s" "$hostname" >.git/gc.pid &&
165+ shell_pid=$$ &&
166+ if test_have_prereq MINGW && test -f /proc/$shell_pid/winpid
167+ then
168+ # In Git for Windows, Bash (actually, the MSYS2 runtime) has a
169+ # different idea of PIDs than git.exe (actually Windows). Use
170+ # the Windows PID in this case.
171+ shell_pid=$(cat /proc/$shell_pid/winpid)
172+ fi &&
173+ printf "%d %s" "$shell_pid" "$hostname" >.git/gc.pid &&
166174
167175 # our gc should exit zero without doing anything
168176 run_and_wait_for_auto_gc &&
You can’t perform that action at this time.
0 commit comments