From: Junio C Hamano Date: Thu, 2 Aug 2018 22:30:43 +0000 (-0700) Subject: Merge branch 'kg/gc-auto-windows-workaround' X-Git-Tag: v2.19.0-rc0~100 X-Git-Url: https://www.git.lorimer.id.au/gitweb.git/diff_plain/562413eb2938b7a1aa85a2ae157ef162d51e55dc?hp=ae533c4a92aef6ab180441dbb76ef83521fc87d6 Merge branch 'kg/gc-auto-windows-workaround' "git gc --auto" opens file descriptors for the packfiles before spawning "git repack/prune", which would upset Windows that does not want a process to work on a file that is open by another process. The issue has been worked around. * kg/gc-auto-windows-workaround: gc --auto: release pack files before auto packing --- diff --git a/builtin/gc.c b/builtin/gc.c index e103f0f85d..57069442b0 100644 --- a/builtin/gc.c +++ b/builtin/gc.c @@ -615,6 +615,7 @@ int cmd_gc(int argc, const char **argv, const char *prefix) return -1; if (!repository_format_precious_objects) { + close_all_packs(the_repository->objects); if (run_command_v_opt(repack.argv, RUN_GIT_CMD)) return error(FAILED_RUN, repack.argv[0]); diff --git a/t/t5510-fetch.sh b/t/t5510-fetch.sh index 4e6d049b94..62308be499 100755 --- a/t/t5510-fetch.sh +++ b/t/t5510-fetch.sh @@ -828,9 +828,11 @@ test_expect_success 'fetching with auto-gc does not lock up' ' test_commit test2 && ( cd auto-gc && + git config fetch.unpackLimit 1 && git config gc.autoPackLimit 1 && git config gc.autoDetach false && GIT_ASK_YESNO="$D/askyesno" git fetch >fetch.out 2>&1 && + test_i18ngrep "Auto packing the repository" fetch.out && ! grep "Should I try again" fetch.out ) '