]> git.ipfire.org Git - thirdparty/git.git/commitdiff
fsmonitor: prefer repo_git_path() to git_pathdup()
authorJeff King <peff@peff.net>
Mon, 18 Sep 2023 22:29:40 +0000 (18:29 -0400)
committerJunio C Hamano <gitster@pobox.com>
Mon, 18 Sep 2023 22:56:14 +0000 (15:56 -0700)
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>
compat/fsmonitor/fsm-ipc-win32.c

index 8928fa93ce223968ab59279ddac50a3dd2b15239..41984ea48e26b8c5fc9cf8ed9bc6851957a230d9 100644 (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;
 }