Skip to content

Commit d20822e

Browse files
committed
Merge branch 'kg/gc-auto-windows-workaround' into pu
"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
2 parents 22e5ddc + 12e73a3 commit d20822e

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

builtin/gc.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -616,6 +616,7 @@ int cmd_gc(int argc, const char **argv, const char *prefix)
616616
return -1;
617617

618618
if (!repository_format_precious_objects) {
619+
close_all_packs(the_repository->objects);
619620
if (run_command_v_opt(repack.argv, RUN_GIT_CMD))
620621
return error(FAILED_RUN, repack.argv[0]);
621622

t/t5510-fetch.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -828,9 +828,11 @@ test_expect_success 'fetching with auto-gc does not lock up' '
828828
test_commit test2 &&
829829
(
830830
cd auto-gc &&
831+
git config fetch.unpackLimit 1 &&
831832
git config gc.autoPackLimit 1 &&
832833
git config gc.autoDetach false &&
833834
GIT_ASK_YESNO="$D/askyesno" git fetch >fetch.out 2>&1 &&
835+
test_i18ngrep "Auto packing the repository" fetch.out &&
834836
! grep "Should I try again" fetch.out
835837
)
836838
'

0 commit comments

Comments
 (0)