Thread (278 messages) 278 messages, 6 authors, 2026-08-07

Re: [PATCH v24 0/7] branch: delete-merged

From: Junio C Hamano <hidden>
Date: 2026-08-04 21:04:39

Phillip Wood [off-list ref] writes:
As far as I can see, from here ...
quoted
      @@ builtin/branch.c: static int parse_opt_forked(const struct option *opt, const ch
...
quoted
      ++	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.
quoted
       +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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help