Skip to content

Commit 0cbe5b3

Browse files
committed
Merge 'release-gc-repack' into HEAD
2 parents b44e6b9 + 84b7c15 commit 0cbe5b3

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
@@ -477,8 +477,10 @@ int cmd_gc(int argc, const char **argv, const char *prefix)
477477

478478
report_garbage = report_pack_garbage;
479479
reprepare_packed_git();
480-
if (pack_garbage.nr > 0)
480+
if (pack_garbage.nr > 0) {
481+
close_all_packs();
481482
clean_pack_garbage();
483+
}
482484

483485
if (auto_gc && too_many_loose_objects())
484486
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;
@@ -307,6 +308,8 @@ int cmd_repack(int argc, const char **argv, const char *prefix)
307308
if (!names.nr && !quiet)
308309
printf("Nothing new to pack.\n");
309310

311+
close_all_packs();
312+
310313
/*
311314
* Ok we have prepared all new packfiles.
312315
* First see if there are packs of the same name and if so

0 commit comments

Comments
 (0)