Skip to content

Commit 08fd8a0

Browse files
committed
Merge branch 'nd/fetch-pass-quiet-to-gc-child-process' into maint
* nd/fetch-pass-quiet-to-gc-child-process: fetch: silence git-gc if --quiet is given fetch: convert argv_gc_auto to struct argv_array
2 parents fb6f843 + 6fceed3 commit 08fd8a0

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

builtin/fetch.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1110,9 +1110,7 @@ int cmd_fetch(int argc, const char **argv, const char *prefix)
11101110
struct string_list list = STRING_LIST_INIT_NODUP;
11111111
struct remote *remote;
11121112
int result = 0;
1113-
static const char *argv_gc_auto[] = {
1114-
"gc", "--auto", NULL,
1115-
};
1113+
struct argv_array argv_gc_auto = ARGV_ARRAY_INIT;
11161114

11171115
packet_trace_identity("fetch");
11181116

@@ -1198,7 +1196,11 @@ int cmd_fetch(int argc, const char **argv, const char *prefix)
11981196
list.strdup_strings = 1;
11991197
string_list_clear(&list, 0);
12001198

1201-
run_command_v_opt(argv_gc_auto, RUN_GIT_CMD);
1199+
argv_array_pushl(&argv_gc_auto, "gc", "--auto", NULL);
1200+
if (verbosity < 0)
1201+
argv_array_push(&argv_gc_auto, "--quiet");
1202+
run_command_v_opt(argv_gc_auto.argv, RUN_GIT_CMD);
1203+
argv_array_clear(&argv_gc_auto);
12021204

12031205
return result;
12041206
}

0 commit comments

Comments
 (0)