[PATCH v2 3/5] commit: reinstate "gc --auto"
This check was lost after sh->C conversion
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
---
Documentation/config.txt | 4 ++++
builtin/commit.c | 2 ++
2 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/Documentation/config.txt b/Documentation/config.txt
index 3b6d773..8f5dd48 100644
--- a/Documentation/config.txt
+++ b/Documentation/config.txt
@@ -904,6 +904,10 @@ commit.template::
"`~/`" is expanded to the value of `$HOME` and "`~user/`" to the
specified user's home directory.
+commit.autogc::
+ By default, git-commit will run "git gc --auto" after each
+ commit. You can stop it by setting this variable to false.
+
credential.helper::
Specify an external helper to be called when a username or
password credential is needed; the helper may consult external
diff --git a/builtin/commit.c b/builtin/commit.c
index a2ec73d..bf7d0aa 100644
--- a/builtin/commit.c
+++ b/builtin/commit.c
@@ -28,6 +28,7 @@
#include "submodule.h"
#include "gpg-interface.h"
#include "column.h"
+#include "gc.h"
static const char * const builtin_commit_usage[] = {
"git commit [options] [--] <filepattern>...",
@@ -1589,6 +1590,7 @@ int cmd_commit(int argc, const char **argv, const char *prefix)
"new_index file. Check that disk is not full or quota is\n"
"not exceeded, and then \"git reset HEAD\" to recover."));
+ gc("commit.autogc", 0);
rerere(0);
run_hook(get_index_file(), "post-commit", NULL);
if (amend && !no_post_rewrite) {
--
1.7.8.36.g69ee2