git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Allow abbreviations in the first refspec to be merged
@ 2007-09-28 23:34 Daniel Barkalow
  2007-09-28 23:38 ` Shawn O. Pearce
  0 siblings, 1 reply; 2+ messages in thread
From: Daniel Barkalow @ 2007-09-28 23:34 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

The config item for a refspec side and the ref name that it matches
aren't necessarily character-for-character identical. We actually want
to merge a ref by default if: there is no per-branch config, it is the
found result of looking for the match for the first refspec, and the
first refspec is not a pattern. Beyond that, anything that
get_fetch_map() thinks matches is fine.

Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
---
This fixes the configuration you gave for me, and passes all the 
usual tests.

 builtin-fetch.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/builtin-fetch.c b/builtin-fetch.c
index 2f639cc..ac68ff5 100644
--- a/builtin-fetch.c
+++ b/builtin-fetch.c
@@ -102,7 +102,7 @@ static struct ref *get_ref_map(struct transport *transport,
 				    remote->fetch[i].dst[0])
 					*autotags = 1;
 				if (!i && !has_merge && ref_map &&
-				    !strcmp(remote->fetch[0].src, ref_map->name))
+				    !remote->fetch[0].pattern)
 					ref_map->merge = 1;
 			}
 			if (has_merge)
-- 
1.5.3.2.1107.ge9eab8-dirty

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

* Re: [PATCH] Allow abbreviations in the first refspec to be merged
  2007-09-28 23:34 [PATCH] Allow abbreviations in the first refspec to be merged Daniel Barkalow
@ 2007-09-28 23:38 ` Shawn O. Pearce
  0 siblings, 0 replies; 2+ messages in thread
From: Shawn O. Pearce @ 2007-09-28 23:38 UTC (permalink / raw)
  To: Daniel Barkalow; +Cc: Junio C Hamano, git

Daniel Barkalow <barkalow@iabervon.org> wrote:
> The config item for a refspec side and the ref name that it matches
> aren't necessarily character-for-character identical.
[snip]
> diff --git a/builtin-fetch.c b/builtin-fetch.c
> index 2f639cc..ac68ff5 100644
> --- a/builtin-fetch.c
> +++ b/builtin-fetch.c
> @@ -102,7 +102,7 @@ static struct ref *get_ref_map(struct transport *transport,
>  				    remote->fetch[i].dst[0])
>  					*autotags = 1;
>  				if (!i && !has_merge && ref_map &&
> -				    !strcmp(remote->fetch[0].src, ref_map->name))
> +				    !remote->fetch[0].pattern)
>  					ref_map->merge = 1;
>  			}
>  			if (has_merge)

Ooooooooooooh.  Of course.  That makes perfect sense now that I
see your explanation and patch.  Thanks for fixing that!  :-)

-- 
Shawn.

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

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

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-09-28 23:34 [PATCH] Allow abbreviations in the first refspec to be merged Daniel Barkalow
2007-09-28 23:38 ` Shawn O. Pearce

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).