Re: [PATCHv3 6/7] submodule--helper: add remote-branch helper

2016-08-03 Thread Jeff King
On Wed, Aug 03, 2016 at 01:11:51PM -0700, Stefan Beller wrote: > > Coverity complains about "sub" being NULL here, and indeed, it seems > > like an easy segfault: > > > > $ ./git submodule--helper remote-branch foo > > Segmentation fault > > > > I guess this should return NULL in that case. Bu

Re: [PATCHv3 6/7] submodule--helper: add remote-branch helper

2016-08-03 Thread Stefan Beller
On Wed, Aug 3, 2016 at 9:25 AM, Jeff King wrote: > On Thu, Jul 28, 2016 at 05:44:08PM -0700, Stefan Beller wrote: > >> +static const char *remote_submodule_branch(const char *path) >> +{ >> + const struct submodule *sub; >> + gitmodules_config(); >> + git_config(submodule_config, NULL)

Re: [PATCHv3 6/7] submodule--helper: add remote-branch helper

2016-08-03 Thread Jeff King
On Thu, Jul 28, 2016 at 05:44:08PM -0700, Stefan Beller wrote: > +static const char *remote_submodule_branch(const char *path) > +{ > + const struct submodule *sub; > + gitmodules_config(); > + git_config(submodule_config, NULL); > + > + sub = submodule_from_path(null_sha1, path);

[PATCHv3 6/7] submodule--helper: add remote-branch helper

2016-07-28 Thread Stefan Beller
In a later patch we want to enhance the logic for the branch selection. Rewrite the current logic to be in C, so we can directly use C when we enhance the logic. Signed-off-by: Stefan Beller --- builtin/submodule--helper.c | 28 +++- git-submodule.sh| 2 +- 2