Skip to content

Commit 1991006

Browse files
pcloudsgitster
authored andcommitted
fetch: convert argv_gc_auto to struct argv_array
Signed-off-by: Nguyễn Thái Ngọc Duy <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 6c4ab27 commit 1991006

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

builtin/fetch.c

Lines changed: 4 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,9 @@ 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+
run_command_v_opt(argv_gc_auto.argv, RUN_GIT_CMD);
1201+
argv_array_clear(&argv_gc_auto);
12021202

12031203
return result;
12041204
}

0 commit comments

Comments
 (0)