On Thu, Feb 06, 2025 at 08:58:06AM +0100, Patrick Steinhardt wrote: > diff --git a/builtin/worktree.c b/builtin/worktree.c > index 2cea9441a6..761e302a36 100644 > --- a/builtin/worktree.c > +++ b/builtin/worktree.c > @@ -151,7 +151,7 @@ static int delete_git_dir(const char *id) > struct strbuf sb = STRBUF_INIT; > int ret; > > - strbuf_addstr(&sb, git_common_path("worktrees/%s", id)); > + repo_common_path_append(the_repository, &sb, "worktrees/%s", id); > ret = remove_dir_recursively(&sb, 0); > if (ret < 0 && errno == ENOTDIR) > ret = unlink(sb.buf); > @@ -1102,6 +1102,7 @@ static int lock_worktree(int ac, const char **av, const char *prefix, > OPT_END() > }; > struct worktree **worktrees, *wt; > + char *path; > > ac = parse_options(ac, av, prefix, options, git_worktree_lock_usage, 0); > if (ac != 1) > @@ -1122,9 +1123,11 @@ static int lock_worktree(int ac, const char **av, const char *prefix, > die(_("'%s' is already locked"), av[0]); > } > > - write_file(git_common_path("worktrees/%s/locked", wt->id), > - "%s", reason); > + path = repo_common_path(the_repository, "worktrees/%s/locked", wt->id);