From: Junio C Hamano Date: Thu, 15 Sep 2016 21:08:58 GMT Subject: Re: [PATCH 3/2] batch check whether submodule needs pushing into one call Message-ID: In-Reply-To: <20160915121044.GA96648@book.hvoigt.net> Heiko Voigt writes: > if (for_each_remote_ref_submodule(path, has_remote, NULL) > 0) { > struct child_process cp = CHILD_PROCESS_INIT; > - const char *argv[] = {"rev-list", NULL, "--not", "--remotes", "-n", "1" , NULL}; > + > + argv_array_push(&cp.args, "rev-list"); > + sha1_array_for_each_unique(hashes, append_hash_to_argv, &cp.args); > + argv_array_pushl(&cp.args, "--not", "--remotes", "-n", "1" , NULL); > + > struct strbuf buf = STRBUF_INIT; > int needs_pushing = 0; These two become decl-after-stmt; move your new lines a bit lower, perhaps? > - argv[1] = sha1_to_hex(sha1); > - cp.argv = argv; > prepare_submodule_repo_env(&cp.env_array); By the way, with the two new patches, 'pu' seems to start failing some tests, e.g. 5533 5404 5405.