worktree: inline worktree_ref() into its only caller

We have `strbuf_worktree_ref()`, which works on a strbuf, and a wrapper
for it, `worktree_ref()` which returns a string. We even make this
wrapper available through worktree.h. But it only has a single caller,
sitting right next to it in worktree.c.

Just inline the wrapper into its only caller. This means the caller can
quite naturally reuse a single strbuf. We currently achieve something
similar by having a static strbuf in the wrapper.

Signed-off-by: Martin Ågren <martin.agren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Martin Ågren
2020-09-27 15:15:44 +02:00
committed by Junio C Hamano
parent 962dd7ebc3
commit ef2d5547fa
2 changed files with 6 additions and 18 deletions

View File

@ -136,11 +136,4 @@ void strbuf_worktree_ref(const struct worktree *wt,
struct strbuf *sb,
const char *refname);
/*
* Return a refname suitable for access from the current ref
* store. The result will be destroyed at the next call.
*/
const char *worktree_ref(const struct worktree *wt,
const char *refname);
#endif