Skip to content

Commit 9bb8eb0

Browse files
committed
Merge branch 'ab/gc-auto-in-commit'
"git commit" used to run "gc --auto" near the end, which was lost when the command was reimplemented in C by mistake. * ab/gc-auto-in-commit: commit: run git gc --auto just before the post-commit hook
2 parents cdda65a + 095c741 commit 9bb8eb0

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

builtin/commit.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1407,6 +1407,7 @@ int run_commit_hook(int editor_is_used, const char *index_file, const char *name
14071407

14081408
int cmd_commit(int argc, const char **argv, const char *prefix)
14091409
{
1410+
const char *argv_gc_auto[] = {"gc", "--auto", NULL};
14101411
static struct wt_status s;
14111412
static struct option builtin_commit_options[] = {
14121413
OPT__QUIET(&quiet, N_("suppress summary after successful commit")),
@@ -1614,6 +1615,7 @@ int cmd_commit(int argc, const char **argv, const char *prefix)
16141615
"not exceeded, and then \"git reset HEAD\" to recover."));
16151616

16161617
rerere(0);
1618+
run_command_v_opt(argv_gc_auto, RUN_GIT_CMD);
16171619
run_commit_hook(use_editor, get_index_file(), "post-commit", NULL);
16181620
if (amend && !no_post_rewrite) {
16191621
commit_post_rewrite(current_head, &oid);

0 commit comments

Comments
 (0)