git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Merge non-first refs that match first refspec
@ 2007-09-28  3:52 Daniel Barkalow
  2007-09-28  4:15 ` Shawn O. Pearce
  0 siblings, 1 reply; 9+ messages in thread
From: Daniel Barkalow @ 2007-09-28  3:52 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

The code only looked at the first ref in the map of refs when looking
for matches for the first refspec in the case where there is not
per-branch configuration of ref to merge. This is often sufficient,
but not always. Make the logic clearer and test everything in the map.

Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
---
I ran all the usual tests with this, and it seems like it should fix a bug 
you saw, but I don't have the test case to make sure.

 builtin-fetch.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/builtin-fetch.c b/builtin-fetch.c
index 2f639cc..47811c9 100644
--- a/builtin-fetch.c
+++ b/builtin-fetch.c
@@ -101,12 +101,13 @@ static struct ref *get_ref_map(struct transport *transport,
 				if (remote->fetch[i].dst &&
 				    remote->fetch[i].dst[0])
 					*autotags = 1;
-				if (!i && !has_merge && ref_map &&
-				    !strcmp(remote->fetch[0].src, ref_map->name))
-					ref_map->merge = 1;
 			}
 			if (has_merge)
 				add_merge_config(&ref_map, remote_refs, branch, &tail);
+			else
+				for (rm = ref_map; rm; rm = rm->next)
+					if (!strcmp(remote->fetch[0].src, rm->name))
+						rm->merge = 1;
 		} else {
 			ref_map = get_remote_ref(remote_refs, "HEAD");
 			ref_map->merge = 1;
-- 
1.5.3.2.1041.g2df10

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2007-09-28 21:38 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-09-28  3:52 [PATCH] Merge non-first refs that match first refspec Daniel Barkalow
2007-09-28  4:15 ` Shawn O. Pearce
2007-09-28  4:40   ` Daniel Barkalow
2007-09-28  4:48     ` Shawn O. Pearce
2007-09-28  5:12       ` Daniel Barkalow
2007-09-28  5:25         ` Shawn O. Pearce
2007-09-28  9:34     ` Junio C Hamano
2007-09-28 21:23       ` Junio C Hamano
2007-09-28 21:38         ` Daniel Barkalow

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).