Subject: Re: [PATCH v1 1/2] worktree: do not pass strbuf by value

From: Junio C Hamano <[email-masked]>
Date: Mon, 09 Mar 2026 07:48:16 -0700

Deveshi Dwivedi <[email-masked]> writes:

> The function only needs the string values, not the strbuf machinery.
> Switch it to take const char * and update all callers to pass .buf.

Makes perfect sense.  Thanks for noticing and fixing these.

> -		write_worktree_linking_files(dotgit, gitdir, use_relative_paths);
> +		write_worktree_linking_files(dotgit.buf, gitdir.buf, use_relative_paths);
> ...
> -void write_worktree_linking_files(struct strbuf dotgit, struct strbuf gitdir,
> +void write_worktree_linking_files(const char *dotgit, const char *gitdir,
>  				  int use_relative_paths)
>  {

This updated function signature makes it plenty clear that the
function does not modify anything in gitdir, so the caller shouldn't
be affected.  Nice.