aboutsummaryrefslogtreecommitdiff
path: root/path.c
diff options
context:
space:
mode:
Diffstat (limited to 'path.c')
-rw-r--r--path.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/path.c b/path.c
index d726537622..073f631b91 100644
--- a/path.c
+++ b/path.c
@@ -486,17 +486,16 @@ const char *mkpath(const char *fmt, ...)
return cleanup_path(pathname->buf);
}
-const char *worktree_git_path(struct repository *r,
- const struct worktree *wt, const char *fmt, ...)
+const char *worktree_git_path(const struct worktree *wt, const char *fmt, ...)
{
struct strbuf *pathname = get_pathname();
va_list args;
- if (wt && wt->repo != r)
- BUG("worktree not connected to expected repository");
+ if (!wt)
+ BUG("%s() called with NULL worktree", __func__);
va_start(args, fmt);
- repo_git_pathv(r, wt, pathname, fmt, args);
+ repo_git_pathv(wt->repo, wt, pathname, fmt, args);
va_end(args);
return pathname->buf;
}