Thread (11 messages) 11 messages, 3 authors, 2026-01-20

Re: [PATCH 4/4] remote: always allocate branch.push_tracking_ref

From: Patrick Steinhardt <hidden>
Date: 2026-01-19 06:34:18

On Mon, Jan 19, 2026 at 12:23:20AM -0500, Jeff King wrote:
quoted hunk ↗ jump to hunk
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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help