Skip to content

Commit 9bef0b1

Browse files
peffgitster
authored andcommitted
branch: drop unused worktrees variable
After b489b9d (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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent b2463fc commit 9bef0b1

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

builtin/branch.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,6 @@ static void delete_branch_config(const char *branchname)
204204
static int delete_branches(int argc, const char **argv, int force, int kinds,
205205
int quiet)
206206
{
207-
struct worktree **worktrees;
208207
struct commit *head_rev = NULL;
209208
struct object_id oid;
210209
char *name = NULL;
@@ -242,8 +241,6 @@ static int delete_branches(int argc, const char **argv, int force, int kinds,
242241
die(_("Couldn't look up commit object for HEAD"));
243242
}
244243

245-
worktrees = get_worktrees();
246-
247244
for (i = 0; i < argc; i++, strbuf_reset(&bname)) {
248245
char *target = NULL;
249246
int flags = 0;
@@ -314,7 +311,6 @@ static int delete_branches(int argc, const char **argv, int force, int kinds,
314311

315312
free(name);
316313
strbuf_release(&bname);
317-
free_worktrees(worktrees);
318314

319315
return ret;
320316
}

0 commit comments

Comments
 (0)