summaryrefslogtreecommitdiff
path: root/builtin-gc.c
diff options
context:
space:
mode:
authorBrandon Casey <casey@nrlssc.navy.mil>2007-10-10 20:00:27 -0500
committerShawn O. Pearce <spearce@spearce.org>2007-10-15 20:50:05 -0400
commit729f50453cb54e136567b89ba6aecab60f0257c6 (patch)
treea0565187767c08fe4cc67c91f24b7faaf67da2cf /builtin-gc.c
parentedb0e04e819c7cde709d10e03f398d12692259f7 (diff)
downloadgit-729f50453cb54e136567b89ba6aecab60f0257c6.tar.gz
git-gc --auto: simplify "repack" command line building
Since "-a" is removed from the base repack command line, we can simplify how we add additional options to this command line when using --auto. Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil> Signed-off-by: Lars Hjemli <hjemli@gmail.com> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 'builtin-gc.c')
-rw-r--r--builtin-gc.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/builtin-gc.c b/builtin-gc.c
index 6323e0d9db..956c32d1af 100644
--- a/builtin-gc.c
+++ b/builtin-gc.c
@@ -143,8 +143,6 @@ static int too_many_packs(void)
static int need_to_gc(void)
{
- int ac = 0;
-
/*
* Setting gc.auto and gc.autopacklimit to 0 or negative can
* disable the automatic gc.
@@ -158,14 +156,10 @@ static int need_to_gc(void)
* we run "repack -A -d -l". Otherwise we tell the caller
* there is no need.
*/
- argv_repack[ac++] = "repack";
if (too_many_packs())
- argv_repack[ac++] = "-A";
+ append_option(argv_repack, "-A", MAX_ADD);
else if (!too_many_loose_objects())
return 0;
- argv_repack[ac++] = "-d";
- argv_repack[ac++] = "-l";
- argv_repack[ac++] = NULL;
return 1;
}