strbuf_git_common_path(buf, repo, "worktrees/%s", wt->id);
}
-static void do_git_path(const struct repository *repo,
- const struct worktree *wt, struct strbuf *buf,
- const char *fmt, va_list args)
+void repo_git_pathv(const struct repository *repo,
+ const struct worktree *wt, struct strbuf *buf,
+ const char *fmt, va_list args)
{
int gitdir_len;
strbuf_worktree_gitdir(buf, repo, wt);
struct strbuf path = STRBUF_INIT;
va_list args;
va_start(args, fmt);
- do_git_path(repo, NULL, &path, fmt, args);
+ repo_git_pathv(repo, NULL, &path, fmt, args);
va_end(args);
return strbuf_detach(&path, NULL);
}
{
va_list args;
va_start(args, fmt);
- do_git_path(repo, NULL, sb, fmt, args);
+ repo_git_pathv(repo, NULL, sb, fmt, args);
va_end(args);
}
va_list args;
strbuf_reset(buf);
va_start(args, fmt);
- do_git_path(the_repository, NULL, buf, fmt, args);
+ repo_git_pathv(the_repository, NULL, buf, fmt, args);
va_end(args);
return buf->buf;
}
{
va_list args;
va_start(args, fmt);
- do_git_path(the_repository, NULL, sb, fmt, args);
+ repo_git_pathv(the_repository, NULL, sb, fmt, args);
va_end(args);
}
struct strbuf *pathname = get_pathname();
va_list args;
va_start(args, fmt);
- do_git_path(the_repository, NULL, pathname, fmt, args);
+ repo_git_pathv(the_repository, NULL, pathname, fmt, args);
va_end(args);
return pathname->buf;
}
struct strbuf path = STRBUF_INIT;
va_list args;
va_start(args, fmt);
- do_git_path(the_repository, NULL, &path, fmt, args);
+ repo_git_pathv(the_repository, NULL, &path, fmt, args);
va_end(args);
return strbuf_detach(&path, NULL);
}
struct strbuf *pathname = get_pathname();
va_list args;
va_start(args, fmt);
- do_git_path(the_repository, wt, pathname, fmt, args);
+ repo_git_pathv(the_repository, wt, pathname, fmt, args);
va_end(args);
return pathname->buf;
}