From: Brandon Williams Date: Thu, 09 Mar 2017 23:40:40 GMT Subject: Re: [PATCH 12/17] update submodules: add submodule_move_head Message-ID: <20170309234040.GE52558@google.com> In-Reply-To: <20170309221543.15897-13-sbeller@google.com> On 03/09, Stefan Beller wrote: > +static void submodule_reset_index(const char *path) > +{ > + struct child_process cp = CHILD_PROCESS_INIT; > + prepare_submodule_repo_env_no_git_dir(&cp.env_array); > + > + cp.git_cmd = 1; > + cp.no_stdin = 1; > + cp.dir = path; > + > + argv_array_pushf(&cp.args, "--super-prefix=%s/", path); What happens with nested submodules? As in can we reach this code path with super_prefix already being set? If so we would need to include that as part of the super_prefix being passed to the child. Just looking for some clarification. > + argv_array_pushl(&cp.args, "read-tree", "-u", "--reset", NULL); > + > + argv_array_push(&cp.args, EMPTY_TREE_SHA1_HEX); > + > + if (run_command(&cp)) > + die("could not reset submodule index"); > +} > + -- Brandon Williams