From: Jeff King Date: Thu, 14 Aug 2014 19:53:20 GMT Subject: Re: [PATCH 1/2] fetch: convert argv_gc_auto to struct argv_array Message-ID: <20140814195320.GA19337@peff.net> In-Reply-To: <1408017065-17437-1-git-send-email-pclouds@gmail.com> On Thu, Aug 14, 2014 at 06:51:04PM +0700, Nguyễn Thái Ngọc Duy wrote: > - 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,8 @@ 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); > + run_command_v_opt(argv_gc_auto.argv, RUN_GIT_CMD); argv_array_clear() here afterwards? Not a huge deal since we are about to exit, but in the name of good hygiene. -Peff