@matheusbsbs / matheus-bagliano / commits / 729f50453c
Fork 0

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>

Brandon Casey committed Oct 10, 2007 at 20:00 UTC 729f50453cb54e136567b89ba6aecab60f0257c6
1 file changed +1 -7
builtin-gc.c
+1 -7
@@ -143,8 +143,6 @@ static int too_many_packs(void)
143
144 static int need_to_gc(void)
145 {
146 - int ac = 0;
147 -
146 /*
147 * Setting gc.auto and gc.autopacklimit to 0 or negative can
148 * disable the automatic gc.
@@ -158,14 +156,10 @@ static int need_to_gc(void)
156 * we run "repack -A -d -l". Otherwise we tell the caller
157 * there is no need.
158 */
161 - argv_repack[ac++] = "repack";
159 if (too_many_packs())
163 - argv_repack[ac++] = "-A";
160 + append_option(argv_repack, "-A", MAX_ADD);
161 else if (!too_many_loose_objects())
162 return 0;
166 - argv_repack[ac++] = "-d";
167 - argv_repack[ac++] = "-l";
168 - argv_repack[ac++] = NULL;
163 return 1;
164 }
165