Re: [PATCHv5 4/5] worktree: get worktrees from submodules

2016-12-07 Thread Brandon Williams
On 12/07, Stefan Beller wrote: > On Wed, Dec 7, 2016 at 2:45 PM, Junio C Hamano wrote: > > Stefan Beller writes: > > > >> + submodule_common_dir = strbuf_detach(&sb, NULL); > >> + ret = get_worktrees_internal(submodule_common_dir, flags); > >> + > >> + free(submodule_gitdir); > > > >

Re: [PATCHv5 4/5] worktree: get worktrees from submodules

2016-12-07 Thread Stefan Beller
On Wed, Dec 7, 2016 at 2:45 PM, Junio C Hamano wrote: > Stefan Beller writes: > >> + submodule_common_dir = strbuf_detach(&sb, NULL); >> + ret = get_worktrees_internal(submodule_common_dir, flags); >> + >> + free(submodule_gitdir); > > This sequence felt somewhat unusual. I would hav

Re: [PATCHv5 4/5] worktree: get worktrees from submodules

2016-12-07 Thread Junio C Hamano
Stefan Beller writes: > + submodule_common_dir = strbuf_detach(&sb, NULL); > + ret = get_worktrees_internal(submodule_common_dir, flags); > + > + free(submodule_gitdir); This sequence felt somewhat unusual. I would have written this without an extra variable, i.e. ret = get

[PATCHv5 4/5] worktree: get worktrees from submodules

2016-12-07 Thread Stefan Beller
In a later patch we want to move around the the git directory of a submodule. Both submodules as well as worktrees are involved in placing git directories at unusual places, so their functionality may collide. To react appropriately to situations where worktrees in submodules are in use, offer a ne