Commit 9bb8eb0c authored by Junio C Hamano's avatar Junio C Hamano

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
parents cdda65ac 095c741e
......@@ -1407,6 +1407,7 @@ int run_commit_hook(int editor_is_used, const char *index_file, const char *name
int cmd_commit(int argc, const char **argv, const char *prefix)
const char *argv_gc_auto[] = {"gc", "--auto", NULL};
static struct wt_status s;
static struct option builtin_commit_options[] = {
OPT__QUIET(&quiet, N_("suppress summary after successful commit")),
......@@ -1614,6 +1615,7 @@ int cmd_commit(int argc, const char **argv, const char *prefix)
"not exceeded, and then \"git reset HEAD\" to recover."));
run_command_v_opt(argv_gc_auto, RUN_GIT_CMD);
run_commit_hook(use_editor, get_index_file(), "post-commit", NULL);
if (amend && !no_post_rewrite) {
commit_post_rewrite(current_head, &oid);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment