Skip to content

Commit 9b68f5a

Browse files
authored
Merge pull request git-for-windows#1769 from gitster/kg/gc-auto-windows-workaround
gc --auto: release pack files before auto packing
2 parents 07e862c + 12e73a3 commit 9b68f5a

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
@@ -612,6 +612,7 @@ int cmd_gc(int argc, const char **argv, const char *prefix)
612612
return -1;
613613

614614
if (!repository_format_precious_objects) {
615+
close_all_packs(the_repository->objects);
615616
if (run_command_v_opt(repack.argv, RUN_GIT_CMD))
616617
return error(FAILED_RUN, repack.argv[0]);
617618

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)