aboutsummaryrefslogtreecommitdiffstats
path: root/hook.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2025-03-05 10:37:43 -0800
committerJunio C Hamano <gitster@pobox.com>2025-03-05 10:37:43 -0800
commitfeffb34257ee8eef18cc6a3a5a4f01d40720bda1 (patch)
tree02842b3ce862be72ad6a0ace18aca0fa1a4f1ca7 /hook.c
parentGit 2.49-rc1 (diff)
parentpath: adjust last remaining users of `the_repository` (diff)
downloadgit-feffb34257ee8eef18cc6a3a5a4f01d40720bda1.tar.gz
git-feffb34257ee8eef18cc6a3a5a4f01d40720bda1.zip
Merge branch 'ps/path-sans-the-repository'
The path.[ch] API takes an explicit repository parameter passed throughout the callchain, instead of relying on the_repository singleton instance. * ps/path-sans-the-repository: path: adjust last remaining users of `the_repository` environment: move access to "core.sharedRepository" into repo settings environment: move access to "core.hooksPath" into repo settings repo-settings: introduce function to clear struct path: drop `git_path()` in favor of `repo_git_path()` rerere: let `rerere_path()` write paths into a caller-provided buffer path: drop `git_common_path()` in favor of `repo_common_path()` worktree: return allocated string from `get_worktree_git_dir()` path: drop `git_path_buf()` in favor of `repo_git_path_replace()` path: drop `git_pathdup()` in favor of `repo_git_path()` path: drop unused `strbuf_git_path()` function path: refactor `repo_submodule_path()` family of functions submodule: refactor `submodule_to_gitdir()` to accept a repo path: refactor `repo_worktree_path()` family of functions path: refactor `repo_git_path()` family of functions path: refactor `repo_common_path()` family of functions
Diffstat (limited to 'hook.c')
-rw-r--r--hook.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/hook.c b/hook.c
index 9ddbdee06d..b3de1048bf 100644
--- a/hook.c
+++ b/hook.c
@@ -16,8 +16,7 @@ const char *find_hook(struct repository *r, const char *name)
int found_hook;
- strbuf_reset(&path);
- strbuf_repo_git_path(&path, r, "hooks/%s", name);
+ repo_git_path_replace(r, &path, "hooks/%s", name);
found_hook = access(path.buf, X_OK) >= 0;
#ifdef STRIP_EXTENSION
if (!found_hook) {