summaryrefslogtreecommitdiff
path: root/builtin/branch.c
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2022-06-18 23:55:16 -0400
committerJunio C Hamano <gitster@pobox.com>2022-06-21 08:52:37 -0700
commit9bef0b1e6ec371e786c2fba3edcc06ad040a536c (patch)
tree24c140edca35b08f2130de92243e75a9e8d08389 /builtin/branch.c
parentb2463fc30a43a43b5de788fa1611603f84097873 (diff)
downloadgit-9bef0b1e6ec371e786c2fba3edcc06ad040a536c.tar.gz
branch: drop unused worktrees variable
After b489b9d9aa (branch: use branch_checked_out() when deleting refs, 2022-06-14), we no longer look at our local "worktrees" variable, since branch_checked_out() handles it under the hood. The compiler didn't notice the unused variable because we call functions to initialize and free it (so it's not totally unused, it just doesn't do anything useful). Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/branch.c')
-rw-r--r--builtin/branch.c4
1 files changed, 0 insertions, 4 deletions
diff --git a/builtin/branch.c b/builtin/branch.c
index f875952e7b..55cd9a6e99 100644
--- a/builtin/branch.c
+++ b/builtin/branch.c
@@ -204,7 +204,6 @@ static void delete_branch_config(const char *branchname)
static int delete_branches(int argc, const char **argv, int force, int kinds,
int quiet)
{
- struct worktree **worktrees;
struct commit *head_rev = NULL;
struct object_id oid;
char *name = NULL;
@@ -242,8 +241,6 @@ static int delete_branches(int argc, const char **argv, int force, int kinds,
die(_("Couldn't look up commit object for HEAD"));
}
- worktrees = get_worktrees();
-
for (i = 0; i < argc; i++, strbuf_reset(&bname)) {
char *target = NULL;
int flags = 0;
@@ -314,7 +311,6 @@ static int delete_branches(int argc, const char **argv, int force, int kinds,
free(name);
strbuf_release(&bname);
- free_worktrees(worktrees);
return ret;
}