path: drop git_pathdup()
in favor of repo_git_path()
Remove `git_pathdup()` in favor of `repo_git_path()`. 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:

committed by
Junio C Hamano

parent
7f17900b5b
commit
bba59f58a4
16
path.h
16
path.h
@ -292,24 +292,10 @@ static inline const char *git_path(const char *fmt, ...)
|
||||
{ \
|
||||
static char *ret; \
|
||||
if (!ret) \
|
||||
ret = git_pathdup(filename); \
|
||||
ret = repo_git_path(the_repository, filename); \
|
||||
return ret; \
|
||||
}
|
||||
|
||||
/*
|
||||
* Return a path into the main repository's (the_repository) git directory.
|
||||
*/
|
||||
__attribute__((format (printf, 1, 2)))
|
||||
static inline char *git_pathdup(const char *fmt, ...)
|
||||
{
|
||||
struct strbuf path = STRBUF_INIT;
|
||||
va_list args;
|
||||
va_start(args, fmt);
|
||||
repo_git_pathv(the_repository, NULL, &path, fmt, args);
|
||||
va_end(args);
|
||||
return strbuf_detach(&path, NULL);
|
||||
}
|
||||
|
||||
# endif /* USE_THE_REPOSITORY_VARIABLE */
|
||||
|
||||
#endif /* PATH_H */
|
||||
|
Reference in New Issue
Block a user