Re: [PATCH 4/4] remote: always allocate branch.push_tracking_ref
- From
Patrick Steinhardt <ps@pks.im>
- Date
- Jan 19, 2026, 06:34 UTC
- Message-ID
- <aW3QZaYoPQvBkfvd@pks.im>
- In-Reply-To
- <20260119052320.GD1991523@coredump.intra.peff.net>
On Mon, Jan 19, 2026 at 12:23:20AM -0500, Jeff King wrote:
Show 13 quoted lines
> diff --git a/remote.c b/remote.c > index e191b0ff6e..3e9d9b3e1f 100644 > --- a/remote.c > +++ b/remote.c > @@ -1924,7 +1925,7 @@ static const char *branch_get_push_1(struct repository *repo, > return tracking_for_push_dest(remote, branch->refname, err); > > case PUSH_DEFAULT_UPSTREAM: > - return branch_get_upstream(branch, err); > + return xstrdup_or_null(branch_get_upstream(branch, err)); > > case PUSH_DEFAULT_UNSPECIFIED: > case PUSH_DEFAULT_SIMPLE:
Makes sense. I was wondering whether you'd also change `branch_get_push_1()` in a subsequent patch, so I'm happy to see this.
This whole series looks good to me, thanks!
Patrick