summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2018-03-08 12:36:30 -0800
committerJunio C Hamano <gitster@pobox.com>2018-03-08 12:36:30 -0800
commit9bb8eb0c88d210d3575bd484320f9abfef551ed1 (patch)
treeb10817207c4074e8db4aca936ce7bc4c04658bc5
parentcdda65acae0b05a197c9f6684d517a5c4325c08f (diff)
parent095c741edd1d9604b6c285000a836721fd69f051 (diff)
downloadgit-9bb8eb0c88d210d3575bd484320f9abfef551ed1.tar.gz
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
-rw-r--r--builtin/commit.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/builtin/commit.c b/builtin/commit.c
index c14f95dbf6..092077c3ee 100644
--- a/builtin/commit.c
+++ b/builtin/commit.c
@@ -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."));
rerere(0);
+ 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);