Thread (7 messages) 7 messages, 4 authors, 2016-06-15

Re: [PATCH 2/2] builtin/fetch.c: ignore merge config when not fetching from branch's remote

flat view

From: Jonathan Nieder <hidden>
Date: 2016-06-15 22:49:23

Possibly related (same subject, not in this thread)

Brandon Casey wrote:
If the argument to fetch does not specify a named remote, or if the name
supplied does not match the remote configured for the current branch, then
the current branch's merge configuration should not be considered.
Thanks for a fix.
quoted hunk ↗ jump to hunk
+++ b/builtin/fetch.c
@@ -146,7 +146,8 @@ static struct ref *get_ref_map(struct transport *transport,
 		struct remote *remote = transport->remote;
 		struct branch *branch = branch_get(NULL);
 		int has_merge = branch_has_merge_config(branch);
-		if (remote && (remote->fetch_refspec_nr || has_merge)) {
+		if (remote && (remote->fetch_refspec_nr || (has_merge &&
+				!strcmp(branch->remote_name, remote->name)))) {
What will happen with this (invalid) branch?

	[branch "tmp"]
		merge = refs/heads/tmp
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help