path: drop git_path_buf() in favor of repo_git_path_replace()

Remove `git_path_buf()` in favor of `repo_git_path_replace()`. The
latter does essentially the same, with the only exception that it does
not rely on `the_repository` but takes the repo as separate parameter.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Patrick Steinhardt
2025-02-07 12:03:33 +01:00
committed by Junio C Hamano
parent bba59f58a4
commit 3859e39659
6 changed files with 24 additions and 41 deletions

16
path.h
View File

@ -256,22 +256,6 @@ static inline const char *git_common_path(const char *fmt, ...)
return pathname->buf;
}
/*
* Construct a path into the main repository's (the_repository) git directory
* and place it in the provided buffer `buf`, the contents of the buffer will
* be overridden.
*/
__attribute__((format (printf, 2, 3)))
static inline char *git_path_buf(struct strbuf *buf, const char *fmt, ...)
{
va_list args;
strbuf_reset(buf);
va_start(args, fmt);
repo_git_pathv(the_repository, NULL, buf, fmt, args);
va_end(args);
return buf->buf;
}
/*
* Return a statically allocated path into the main repository's
* (the_repository) git directory.