summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2020-03-02 23:07:20 (GMT)
committerJunio C Hamano <gitster@pobox.com>2020-03-02 23:07:20 (GMT)
commit4cbf1a0e220d12604afeec208ed18af0766077ac (patch)
tree15b55a6aec0f1f77bf16465c039c029812c9319f
parent46703057c1a0f85e24c0144b38c226c6a9ccb737 (diff)
parent02bbbe9df9d5e90e4810fdcd6b46bbfbf5fd2bbf (diff)
downloadgit-4cbf1a0e220d12604afeec208ed18af0766077ac.zip
git-4cbf1a0e220d12604afeec208ed18af0766077ac.tar.gz
git-4cbf1a0e220d12604afeec208ed18af0766077ac.tar.bz2
Merge branch 'es/worktree-cleanup'
Code cleanup. * es/worktree-cleanup: worktree: drop unused code from get_main_worktree()
-rw-r--r--worktree.c4
1 files changed, 0 insertions, 4 deletions
diff --git a/worktree.c b/worktree.c
index 5b4793c..33c2655 100644
--- a/worktree.c
+++ b/worktree.c
@@ -47,15 +47,12 @@ static void add_head_info(struct worktree *wt)
static struct worktree *get_main_worktree(void)
{
struct worktree *worktree = NULL;
- struct strbuf path = STRBUF_INIT;
struct strbuf worktree_path = STRBUF_INIT;
strbuf_add_absolute_path(&worktree_path, get_git_common_dir());
if (!strbuf_strip_suffix(&worktree_path, "/.git"))
strbuf_strip_suffix(&worktree_path, "/.");
- strbuf_addf(&path, "%s/HEAD", get_git_common_dir());
-
worktree = xcalloc(1, sizeof(*worktree));
worktree->path = strbuf_detach(&worktree_path, NULL);
/*
@@ -69,7 +66,6 @@ static struct worktree *get_main_worktree(void)
is_bare_repository();
add_head_info(worktree);
- strbuf_release(&path);
strbuf_release(&worktree_path);
return worktree;
}