summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2014-09-19 14:05:12 -0700
committerJunio C Hamano <gitster@pobox.com>2014-09-19 14:05:12 -0700
commit08fd8a055cd11291020bf8c6f83d27cdc55df419 (patch)
tree2ac1c3b4efbb537398e4d10a0235d1f62d09c9a8
parentfb6f843a8fbce633a4a1f39f4b7b2a862e5cb855 (diff)
parent6fceed3bea59d747c160972c67663e8b8c281229 (diff)
downloadgit-08fd8a055cd11291020bf8c6f83d27cdc55df419.tar.gz
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
-rw-r--r--builtin/fetch.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/builtin/fetch.c b/builtin/fetch.c
index e8d0cca3e4..159fb7e916 100644
--- a/builtin/fetch.c
+++ b/builtin/fetch.c
@@ -1110,9 +1110,7 @@ int cmd_fetch(int argc, const char **argv, const char *prefix)
struct string_list list = STRING_LIST_INIT_NODUP;
struct remote *remote;
int result = 0;
- static const char *argv_gc_auto[] = {
- "gc", "--auto", NULL,
- };
+ struct argv_array argv_gc_auto = ARGV_ARRAY_INIT;
packet_trace_identity("fetch");
@@ -1198,7 +1196,11 @@ int cmd_fetch(int argc, const char **argv, const char *prefix)
list.strdup_strings = 1;
string_list_clear(&list, 0);
- run_command_v_opt(argv_gc_auto, RUN_GIT_CMD);
+ argv_array_pushl(&argv_gc_auto, "gc", "--auto", NULL);
+ if (verbosity < 0)
+ argv_array_push(&argv_gc_auto, "--quiet");
+ run_command_v_opt(argv_gc_auto.argv, RUN_GIT_CMD);
+ argv_array_clear(&argv_gc_auto);
return result;
}