@matheusbsbs / matheus-bagliano / commits / 02bbbe9df9
Fork 0

worktree: drop unused code from get_main_worktree()

This code has been unused since fa099d2322 (worktree.c: kill parse_ref() in favor of refs_resolve_ref_unsafe(), 2017-04-24), so drop it. Signed-off-by: Eric Sunshine <sunshine@sunshineco.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Eric Sunshine committed Feb 23, 2020 at 20:59 UTC 02bbbe9df9d5e90e4810fdcd6b46bbfbf5fd2bbf
1 file changed -4
worktree.c
-4
@@ -47,15 +47,12 @@ static void add_head_info(struct worktree *wt)
47 static struct worktree *get_main_worktree(void)
48 {
49 struct worktree *worktree = NULL;
50 - struct strbuf path = STRBUF_INIT;
50 struct strbuf worktree_path = STRBUF_INIT;
51
52 strbuf_add_absolute_path(&worktree_path, get_git_common_dir());
53 if (!strbuf_strip_suffix(&worktree_path, "/.git"))
54 strbuf_strip_suffix(&worktree_path, "/.");
55
57 - strbuf_addf(&path, "%s/HEAD", get_git_common_dir());
58 -
56 worktree = xcalloc(1, sizeof(*worktree));
57 worktree->path = strbuf_detach(&worktree_path, NULL);
58 /*
@@ -69,7 +66,6 @@ static struct worktree *get_main_worktree(void)
66 is_bare_repository();
67 add_head_info(worktree);
68
72 - strbuf_release(&path);
69 strbuf_release(&worktree_path);
70 return worktree;
71 }