setup: mark `set_git_work_tree()` as file-local
In the preceding commit we have removed the last callers of `set_git_work_tree()` that is located outside of "setup.c". Remove its declaration and mark the function as file-local. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Patrick Steinhardt committed
Jul 7, 2026 at 09:21 UTC
4df38c632f6808818018711b0c593aafe4c463c7
2 files changed
+1
-3
setup.c
+1
-1
@@ -1904,7 +1904,7 @@ const char *enter_repo(struct repository *repo, const char *path, unsigned flags
1904
* primarily to support git-clone to work in a new repository it just
1905
* created, and is not meant to flip between different work trees.
1906
*/
1907
-void set_git_work_tree(struct repository *repo, const char *new_work_tree)
1907
+static void set_git_work_tree(struct repository *repo, const char *new_work_tree)
1908
{
1909
if (repo->worktree_initialized) {
1910
struct strbuf realpath = STRBUF_INIT;
setup.h
-2
@@ -96,8 +96,6 @@ static inline int discover_git_directory(struct strbuf *commondir,
96
return 0;
97
}
98
99
-void set_git_work_tree(struct repository *repo, const char *tree);
100
-
99
/* Flags that can be passed to `enter_repo()`. */
100
enum {
101
/*