]> git.ipfire.org Git - thirdparty/git.git/commitdiff
worktree: drop pointless strbuf_release()
authorEric Sunshine <sunshine@sunshineco.com>
Fri, 31 Jul 2020 23:32:11 +0000 (19:32 -0400)
committerJunio C Hamano <gitster@pobox.com>
Sat, 1 Aug 2020 02:56:10 +0000 (19:56 -0700)
The content of this strbuf is unconditionally detached several lines
before the strbuf_release() and the strbuf is never touched again after
that point.

Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
worktree.c

index cba2e545982c0487160244100af44a14d2e9a898..c0df5e2c7969c8c032fd83a7d077ca211e980814 100644 (file)
@@ -66,8 +66,6 @@ static struct worktree *get_main_worktree(void)
        worktree->is_bare = (is_bare_repository_cfg == 1) ||
                is_bare_repository();
        add_head_info(worktree);
-
-       strbuf_release(&worktree_path);
        return worktree;
 }