1
0
mirror of https://github.com/git/git.git synced 2024-09-28 08:49:45 +02:00

fsmonitor: prefer repo_git_path() to git_pathdup()

The fsmonitor_ipc__get_path() function ignores its repository argument.
It should use it when constructing repo paths (though in practice, it is
unlikely anything but the_repository is ever passed, so this is cleanup
and future proofing, not a bug fix).

Note that despite the lack of "dup" in the name, repo_git_path() behaves
like git_pathdup() and returns an allocated string.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Jeff King 2023-09-18 18:29:40 -04:00 committed by Junio C Hamano
parent 43c8a30d15
commit 00df20a7ab

View File

@ -6,6 +6,6 @@
const char *fsmonitor_ipc__get_path(struct repository *r) {
static char *ret;
if (!ret)
ret = git_pathdup("fsmonitor--daemon.ipc");
ret = repo_git_path(r, "fsmonitor--daemon.ipc");
return ret;
}