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 Jun 14, 2018
2 parents 1467b4c + 44f58d6 commit 1acebcb
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 @@ -638,8 +638,10 @@ int cmd_gc(int argc, const char **argv, const char *prefix)

report_garbage = report_pack_garbage;
reprepare_packed_git(the_repository);
if (pack_garbage.nr > 0)
if (pack_garbage.nr > 0) {
close_all_packs(the_repository->objects);
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 @@ -323,6 +324,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(the_repository->objects);

/*
* 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 1acebcb

Please sign in to comment.