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>
This commit is contained in:
parent
b2463fc30a
commit
9bef0b1e6e
@ -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,
|
static int delete_branches(int argc, const char **argv, int force, int kinds,
|
||||||
int quiet)
|
int quiet)
|
||||||
{
|
{
|
||||||
struct worktree **worktrees;
|
|
||||||
struct commit *head_rev = NULL;
|
struct commit *head_rev = NULL;
|
||||||
struct object_id oid;
|
struct object_id oid;
|
||||||
char *name = NULL;
|
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"));
|
die(_("Couldn't look up commit object for HEAD"));
|
||||||
}
|
}
|
||||||
|
|
||||||
worktrees = get_worktrees();
|
|
||||||
|
|
||||||
for (i = 0; i < argc; i++, strbuf_reset(&bname)) {
|
for (i = 0; i < argc; i++, strbuf_reset(&bname)) {
|
||||||
char *target = NULL;
|
char *target = NULL;
|
||||||
int flags = 0;
|
int flags = 0;
|
||||||
@ -314,7 +311,6 @@ static int delete_branches(int argc, const char **argv, int force, int kinds,
|
|||||||
|
|
||||||
free(name);
|
free(name);
|
||||||
strbuf_release(&bname);
|
strbuf_release(&bname);
|
||||||
free_worktrees(worktrees);
|
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user