Re: [PATCH v3 10/20] path: convert do_git_path to take a 'struct repository'
- From
- Brandon Williams <bmwill@google.com>
- Date
- Jun 21, 2017, 21:20 UTC
- Message-ID
- <20170621212019.GB53348@google.com>
- In-Reply-To
- <20170620152308.42984ee7@twelve2.svl.corp.google.com>
On 06/20, Jonathan Tan wrote:
Show 12 quoted lines
> On Tue, 20 Jun 2017 12:19:41 -0700
> Brandon Williams <bmwill@google.com> wrote:
>
> > +static void do_git_path(const struct repository *repo,
> > + const struct worktree *wt, struct strbuf *buf,
> > const char *fmt, va_list args)
> > {
> > int gitdir_len;
> > - strbuf_addstr(buf, get_worktree_git_dir(wt));
>
> With this change, the get_worktree_git_dir() function no longer seems to
> be used from outside - could it be marked static?Probably? But you could argue that it is ok to be part of the public API. As in it may be ok to leave as is because some future caller may want it at some point.
Show 10 quoted lines
> > > + strbuf_worktree_gitdir(buf, repo, wt); > > if (buf->len && !is_dir_sep(buf->buf[buf->len - 1])) > > strbuf_addch(buf, '/'); > > gitdir_len = buf->len; > > strbuf_vaddf(buf, fmt, args); > > - adjust_git_path(buf, gitdir_len); > > + adjust_git_path(repo, buf, gitdir_len); > > strbuf_cleanup_path(buf); > > }
-- Brandon Williams