Re: [PATCH v24 0/7] branch: delete-merged
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Aug 4, 2026, 21:04 UTC
- Message-ID
- <xmqqcxvxtx5n.fsf@gitster.g>
- In-Reply-To
- <0ea7bbec-3381-4bc6-99a9-2c3b5d1bfebd@gmail.com>
Phillip Wood <phillip.wood123@gmail.com> writes:
Show 39 quoted lines
> As far as I can see, from here ...
>
>> @@ builtin/branch.c: static int parse_opt_forked(const struct option *opt, const ch
>...
>> ++ strbuf_release(&key);
>> +}
>
> ... to here pretty much takes us back to V19 with the difference that we
> only prune protected branches from the deleteable set after we've
> visited all the branches - looks good.
>
>> +static int branch_pushes_to_upstream(struct branch *branch,
>> + const char *upstream)
>> +{
>> + struct remote *remote = remote_get(remote_for_branch(branch, NULL));
>> ++ char *push_refname = NULL;
>> + char *tracking = NULL;
>> + int ret = 0;
>> +
>> -+ if (remote)
>> -+ tracking = apply_refspecs(&remote->fetch, branch->refname);
>> ++ if (!remote)
>> ++ return 0;
>> ++ if (remote->push.nr)
>> ++ push_refname = apply_refspecs(&remote->push, branch->refname);
>> ++ else
>> ++ push_refname = xstrdup(branch->refname);
>> ++ if (push_refname)
>> ++ tracking = apply_refspecs(&remote->fetch, push_refname);
>> + if (tracking && !strcmp(tracking, upstream))
>> + ret = 1;
>> ++ free(push_refname);> + free(tracking);
>> + return ret;
>> +}
>
> This looks good now - we map the branch name with the push refspec if
> there is one and then with the fetch refspec.
>
> The test changes below look good as well.OK.
I'd mark the topic as "expecting a (hopefully small and final) reroll", perhaps.
Thanks.