Skip to content

Commit 107ed55

Browse files
committed
Merge branch 'jc/worktree-git-path'
Code cleanup. * jc/worktree-git-path: worktree_git_path(): move the declaration to path.h
2 parents e5ff701 + bf6a862 commit 107ed55

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

path.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
struct repository;
55
struct strbuf;
66
struct string_list;
7+
struct worktree;
78

89
/*
910
* The result to all functions which return statically allocated memory may be
@@ -81,6 +82,14 @@ void strbuf_repo_git_path(struct strbuf *sb,
8182
const char *git_path(const char *fmt, ...)
8283
__attribute__((format (printf, 1, 2)));
8384

85+
/*
86+
* Similar to git_path() but can produce paths for a specified
87+
* worktree instead of current one
88+
*/
89+
const char *worktree_git_path(const struct worktree *wt,
90+
const char *fmt, ...)
91+
__attribute__((format (printf, 2, 3)));
92+
8493
/*
8594
* Return a path into the main repository's (the_repository) git directory.
8695
*/

revision.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
#include "bisect.h"
3030
#include "packfile.h"
3131
#include "worktree.h"
32+
#include "path.h"
3233
#include "read-cache.h"
3334
#include "setup.h"
3435
#include "sparse-index.h"

worktree.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -177,14 +177,6 @@ int other_head_refs(each_ref_fn fn, void *cb_data);
177177
int is_worktree_being_rebased(const struct worktree *wt, const char *target);
178178
int is_worktree_being_bisected(const struct worktree *wt, const char *target);
179179

180-
/*
181-
* Similar to git_path() but can produce paths for a specified
182-
* worktree instead of current one
183-
*/
184-
const char *worktree_git_path(const struct worktree *wt,
185-
const char *fmt, ...)
186-
__attribute__((format (printf, 2, 3)));
187-
188180
/*
189181
* Return a refname suitable for access from the current ref store.
190182
*/

0 commit comments

Comments
 (0)