Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--builtin-gc.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/builtin-gc.c b/builtin-gc.c
index 093b3dda9f..f046a2a665 100644
--- a/builtin-gc.c
+++ b/builtin-gc.c
@@ -80,6 +80,13 @@ static int need_to_gc(void)
int num_loose = 0;
int needed = 0;
+ /*
+ * Setting gc.auto to 0 or negative can disable the
+ * automatic gc
+ */
+ if (gc_auto_threshold <= 0)
+ return 0;
+
if (sizeof(path) <= snprintf(path, sizeof(path), "%s/17", objdir)) {
warning("insanely long object directory %.*s", 50, objdir);
return 0;
@@ -129,8 +136,6 @@ int cmd_gc(int argc, const char **argv, const char *prefix)
continue;
}
if (!strcmp(arg, "--auto")) {
- if (gc_auto_threshold <= 0)
- return 0;
auto_gc = 1;
continue;
}