Re: [PATCH 07/11] files-backend: remove the use of git_path()
- From
Duy Nguyen <pclouds@gmail.com>
- Date
- Feb 14, 2017, 09:38 UTC
- Message-ID
- <CACsJy8DorHk9Xc9iPhw4DYAUeufVhd8229-GXzC_SaTEUb89RA@mail.gmail.com>
- In-Reply-To
- <CAGZ79kbJXUY=UGvHtkeLLj-qMaoOyTwa2dr3-FqEdYi8eFs4LA@mail.gmail.com>
On Tue, Feb 14, 2017 at 6:09 AM, Stefan Beller <sbeller@google.com> wrote:
Show 14 quoted lines
>> +
>> + if (submodule) {
>> + refs->submodule = xstrdup_or_null(submodule);
>
> drop the _or_null here?
>
> So in this patch we have either
> * submodule set
> * or gitdir/gitcommondir set
>
> which means that we exercise the commondir for regular repos.
> In the future when we want to be able to have a combination of worktrees
> and submodules this ought to be possible by setting submodule != NULL
> and still populating the gitdir/commondir buffers.You probably have seen it by now. In the near future, submodule is completely gone from here. We convert to a .git dir before we pass in here. In a farther future, gitcommondir will be gone too with all the per-worktree logic in this file. A linked worktree consists of two backends actually, one per-worktree (which remains files-based), the other for shared refs, which could be files, lmdb or whatever. Stacking up submodule on top of a linked worktree should not be a problem.
-- Duy