path: add repo_worktree_path and strbuf_repo_worktree_path

Introduce 'repo_worktree_path' and 'strbuf_repo_worktree_path' which
take a repository struct and constructs a path relative to the
repository's worktree.

Signed-off-by: Brandon Williams <bmwill@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Brandon Williams
2017-06-22 11:43:41 -07:00
committed by Junio C Hamano
parent 3181d86320
commit b42b0c0919
2 changed files with 49 additions and 0 deletions

8
path.h
View File

@ -43,6 +43,14 @@ extern void strbuf_repo_git_path(struct strbuf *sb,
const char *fmt, ...)
__attribute__((format (printf, 3, 4)));
extern char *repo_worktree_path(const struct repository *repo,
const char *fmt, ...)
__attribute__((format (printf, 2, 3)));
extern void strbuf_repo_worktree_path(struct strbuf *sb,
const struct repository *repo,
const char *fmt, ...)
__attribute__((format (printf, 3, 4)));
extern void report_linked_checkout_garbage(void);
/*