]> git.ipfire.org Git - thirdparty/git.git/commitdiff
setup: mark `set_git_work_tree()` as file-local
authorPatrick Steinhardt <ps@pks.im>
Tue, 30 Jun 2026 11:47:52 +0000 (13:47 +0200)
committerJunio C Hamano <gitster@pobox.com>
Tue, 30 Jun 2026 18:29:41 +0000 (11:29 -0700)
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>
setup.c
setup.h

diff --git a/setup.c b/setup.c
index 3a1433c618387e6e93b0397879ad1cb2fa34b989..32292bb41909983d0d1f6bbb5a7eb2b7144458bc 100644 (file)
--- a/setup.c
+++ b/setup.c
@@ -1904,7 +1904,7 @@ const char *enter_repo(struct repository *repo, const char *path, unsigned flags
  * primarily to support git-clone to work in a new repository it just
  * created, and is not meant to flip between different work trees.
  */
-void set_git_work_tree(struct repository *repo, const char *new_work_tree)
+static void set_git_work_tree(struct repository *repo, const char *new_work_tree)
 {
        if (repo->worktree_initialized) {
                struct strbuf realpath = STRBUF_INIT;
diff --git a/setup.h b/setup.h
index bf3e3f3ea6ee9ded83a37a35152401771e9266b0..bb24ee8f0fd8633b16ef5a508b055ff4f84f69d7 100644 (file)
--- a/setup.h
+++ b/setup.h
@@ -96,8 +96,6 @@ static inline int discover_git_directory(struct strbuf *commondir,
        return 0;
 }
 
-void set_git_work_tree(struct repository *repo, const char *tree);
-
 /* Flags that can be passed to `enter_repo()`. */
 enum {
        /*