]> git.ipfire.org Git - thirdparty/git.git/commitdiff
worktree_git_path(): move the declaration to path.h
authorJunio C Hamano <gitster@pobox.com>
Sat, 8 Jun 2024 18:39:01 +0000 (11:39 -0700)
committerJunio C Hamano <gitster@pobox.com>
Sat, 8 Jun 2024 18:42:37 +0000 (11:42 -0700)
The definition of this function is in path.c but its declaration is
in worktree.h, which is something unexpected.  The function is
explained as "Similar to git_path()"; declaring it next to where
git_path() is declared would make more sense.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
path.h
revision.c
worktree.h

diff --git a/path.h b/path.h
index ea96487b292bdb149061dc2b35c07e7529ed01ef..0c7596d990535e199ef174c2613f8ab6b3caa710 100644 (file)
--- a/path.h
+++ b/path.h
@@ -4,6 +4,7 @@
 struct repository;
 struct strbuf;
 struct string_list;
+struct worktree;
 
 /*
  * The result to all functions which return statically allocated memory may be
@@ -81,6 +82,14 @@ void strbuf_repo_git_path(struct strbuf *sb,
 const char *git_path(const char *fmt, ...)
        __attribute__((format (printf, 1, 2)));
 
+/*
+ * Similar to git_path() but can produce paths for a specified
+ * worktree instead of current one
+ */
+const char *worktree_git_path(const struct worktree *wt,
+                             const char *fmt, ...)
+       __attribute__((format (printf, 2, 3)));
+
 /*
  * Return a path into the main repository's (the_repository) git directory.
  */
index 7e45f765d9fe16c8380f457c0d40e385cbf88f55..9db534f852e67aa513f487986e46803522ff784a 100644 (file)
@@ -29,6 +29,7 @@
 #include "bisect.h"
 #include "packfile.h"
 #include "worktree.h"
+#include "path.h"
 #include "read-cache.h"
 #include "setup.h"
 #include "sparse-index.h"
index f14784a2ff871c69e5b5e28466439201721407b2..605ed6cb90fcf6064fbe743017b146d5981b5d92 100644 (file)
@@ -175,14 +175,6 @@ int other_head_refs(each_ref_fn fn, void *cb_data);
 int is_worktree_being_rebased(const struct worktree *wt, const char *target);
 int is_worktree_being_bisected(const struct worktree *wt, const char *target);
 
-/*
- * Similar to git_path() but can produce paths for a specified
- * worktree instead of current one
- */
-const char *worktree_git_path(const struct worktree *wt,
-                             const char *fmt, ...)
-       __attribute__((format (printf, 2, 3)));
-
 /*
  * Return a refname suitable for access from the current ref store.
  */