Skip to content

Commit

Permalink
Merge 'release-gc-repack' into HEAD
Browse files Browse the repository at this point in the history
  • Loading branch information
dscho committed May 24, 2018
2 parents 34d7757 + 2d68698 commit ecde480
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 3 additions & 1 deletion builtin/gc.c
Original file line number Diff line number Diff line change
Expand Up @@ -480,8 +480,10 @@ int cmd_gc(int argc, const char **argv, const char *prefix)

report_garbage = report_pack_garbage;
reprepare_packed_git();
if (pack_garbage.nr > 0)
if (pack_garbage.nr > 0) {
close_all_packs();
clean_pack_garbage();
}

if (auto_gc && too_many_loose_objects())
warning(_("There are too many unreachable loose objects; "
Expand Down
3 changes: 3 additions & 0 deletions builtin/repack.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include "strbuf.h"
#include "string-list.h"
#include "argv-array.h"
#include "packfile.h"

static int delta_base_offset = 1;
static int pack_kept_objects = -1;
Expand Down Expand Up @@ -308,6 +309,8 @@ int cmd_repack(int argc, const char **argv, const char *prefix)
if (!names.nr && !quiet)
printf("Nothing new to pack.\n");

close_all_packs();

/*
* Ok we have prepared all new packfiles.
* First see if there are packs of the same name and if so
Expand Down

0 comments on commit ecde480

Please sign in to comment.