Skip to content

Commit 1acebcb

Browse files
committed
Merge 'release-gc-repack' into HEAD
2 parents 1467b4c + 44f58d6 commit 1acebcb

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

builtin/gc.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -638,8 +638,10 @@ int cmd_gc(int argc, const char **argv, const char *prefix)
638638

639639
report_garbage = report_pack_garbage;
640640
reprepare_packed_git(the_repository);
641-
if (pack_garbage.nr > 0)
641+
if (pack_garbage.nr > 0) {
642+
close_all_packs(the_repository->objects);
642643
clean_pack_garbage();
644+
}
643645

644646
if (auto_gc && too_many_loose_objects())
645647
warning(_("There are too many unreachable loose objects; "

builtin/repack.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include "strbuf.h"
99
#include "string-list.h"
1010
#include "argv-array.h"
11+
#include "packfile.h"
1112

1213
static int delta_base_offset = 1;
1314
static int pack_kept_objects = -1;
@@ -323,6 +324,8 @@ int cmd_repack(int argc, const char **argv, const char *prefix)
323324
if (!names.nr && !quiet)
324325
printf("Nothing new to pack.\n");
325326

327+
close_all_packs(the_repository->objects);
328+
326329
/*
327330
* Ok we have prepared all new packfiles.
328331
* First see if there are packs of the same name and if so

0 commit comments

Comments
 (0)