diff options
| author | Junio C Hamano <gitster@pobox.com> | 2026-03-04 10:53:00 -0800 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2026-03-04 10:53:00 -0800 |
| commit | 7b7d67104e315437c46e62986e163c97c5a51dd3 (patch) | |
| tree | 416fbdc26345dfc3c17ce4d4dab6113dd657a381 /path.c | |
| parent | 2d843a2d3d6c2d5e7861e6aa99743d15d36746b9 (diff) | |
| parent | a49cb0f093809e3e66566f161aa930f37346775d (diff) | |
| download | git-7b7d67104e315437c46e62986e163c97c5a51dd3.tar.xz | |
Merge branch 'pw/no-more-NULL-means-current-worktree'
API clean-up for the worktree subsystem.
* pw/no-more-NULL-means-current-worktree:
path: remove repository argument from worktree_git_path()
wt-status: avoid passing NULL worktree
Diffstat (limited to 'path.c')
| -rw-r--r-- | path.c | 9 |
1 files changed, 4 insertions, 5 deletions
@@ -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; } |
