]> git.ipfire.org Git - thirdparty/git.git/commit
path: drop `git_common_path()` in favor of `repo_common_path()`
authorPatrick Steinhardt <ps@pks.im>
Fri, 7 Feb 2025 11:03:35 +0000 (12:03 +0100)
committerJunio C Hamano <gitster@pobox.com>
Fri, 7 Feb 2025 17:59:23 +0000 (09:59 -0800)
commit07242c2a5afb2a633feb110b1aa74e2adcc37575
tree46297aaba2428ebd030ce81fa7cf8706fe88f80e
parent8e4710f011dce286d24838fdafd5ce52cfac5285
path: drop `git_common_path()` in favor of `repo_common_path()`

Remove `git_common_path()` in favor of the `repo_common_path()` family
of functions, which makes the implicit dependency on `the_repository` go
away.

Note that `git_common_path()` used to return a string allocated via
`get_pathname()`, which uses a rotating set of statically allocated
buffers. Consequently, callers didn't have to free the returned string.
The same isn't true for `repo_common_path()`, so we also have to add
logic to free the returned strings.

This refactoring also allows us to remove `repo_common_pathv()` from the
public interface.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/worktree.c
path.c
path.h
worktree.c