Skip to content

Commit 4cbf1a0

Browse files
committed
Merge branch 'es/worktree-cleanup'
Code cleanup. * es/worktree-cleanup: worktree: drop unused code from get_main_worktree()
2 parents 4670305 + 02bbbe9 commit 4cbf1a0

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

worktree.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,12 @@ static void add_head_info(struct worktree *wt)
4747
static struct worktree *get_main_worktree(void)
4848
{
4949
struct worktree *worktree = NULL;
50-
struct strbuf path = STRBUF_INIT;
5150
struct strbuf worktree_path = STRBUF_INIT;
5251

5352
strbuf_add_absolute_path(&worktree_path, get_git_common_dir());
5453
if (!strbuf_strip_suffix(&worktree_path, "/.git"))
5554
strbuf_strip_suffix(&worktree_path, "/.");
5655

57-
strbuf_addf(&path, "%s/HEAD", get_git_common_dir());
58-
5956
worktree = xcalloc(1, sizeof(*worktree));
6057
worktree->path = strbuf_detach(&worktree_path, NULL);
6158
/*
@@ -69,7 +66,6 @@ static struct worktree *get_main_worktree(void)
6966
is_bare_repository();
7067
add_head_info(worktree);
7168

72-
strbuf_release(&path);
7369
strbuf_release(&worktree_path);
7470
return worktree;
7571
}

0 commit comments

Comments
 (0)