path: convert strbuf_git_common_path to take a 'struct repository'

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:37 -07:00
committed by Junio C Hamano
parent 7aee36013a
commit b337172c83
3 changed files with 16 additions and 8 deletions

View File

@ -1,4 +1,5 @@
#include "cache.h"
#include "repository.h"
#include "refs.h"
#include "strbuf.h"
#include "worktree.h"
@ -76,7 +77,7 @@ static struct worktree *get_linked_worktree(const char *id)
if (!id)
die("Missing linked worktree name");
strbuf_git_common_path(&path, "worktrees/%s/gitdir", id);
strbuf_git_common_path(&path, the_repository, "worktrees/%s/gitdir", id);
if (strbuf_read_file(&worktree_path, path.buf, 0) <= 0)
/* invalid gitdir file */
goto done;