Re: [PATCH v14 3/6] branch: prepare delete_branches for a bulk caller
- From
- Phillip Wood <phillip.wood123@gmail.com>
- Date
- Jun 15, 2026, 09:47 UTC
- Message-ID
- <3b04055c-846d-4aaa-99bb-5da932172f75@gmail.com>
- In-Reply-To
- <259113e304c4085c2bd90cce3a40c965744d5a00.1780999917.git.gitgitgadget@gmail.com>
Hi Harald
On 09/06/2026 11:11, Harald Nordgren via GitGitGadget wrote:
Show 7 quoted lines
> > @@ -240,7 +245,7 @@ static int delete_branches(int argc, const char **argv, int kinds, > int i; > int ret = 0; > int remote_branch = 0; > - int force, quiet; > + int force, quiet, dry_run, no_head_fallback;
As with the previous patch it would be safer to initialize the new variables where they are declared.
Show 9 quoted lines
> for_each_string_list_item(item, &refs_to_delete) {
> char *describe_ref = item->util;
> char *name = item->string;
> - if (!refs_ref_exists(get_main_ref_store(the_repository), name)) {
> + if (dry_run) {
> + if (!quiet)
> + printf(remote_branch
> + ? _("Would delete remote-tracking branch %s (was %s).\n")
> + : _("Would delete branch %s (was %s).\n"),I wondered what the "was %s" was about but it prints the symref target or oid of the ref.
Thanks
Phillip
Show 5 quoted lines
> + name + branch_name_pos, describe_ref);
> + } else if (!refs_ref_exists(get_main_ref_store(the_repository), name)) {
> char *refname = name + branch_name_pos;
> if (!quiet)
> printf(remote_branch