summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 689f039)
raw | patch | inline | side by side (parent: 689f039)
author | Daniel Barkalow <barkalow@iabervon.org> | |
Sat, 7 Mar 2009 06:11:29 +0000 (01:11 -0500) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sat, 7 Mar 2009 20:19:19 +0000 (12:19 -0800) |
This will help when the matching changes.
Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
remote.c | patch | blob | history |
diff --git a/remote.c b/remote.c
index d7079c6dd871dc1b482d347d013438fe30cc0908..2816723bb9ec59b7fb873246131615ca8496a9b3 100644 (file)
--- a/remote.c
+++ b/remote.c
return 0;
}
+static int match_name_with_pattern(const char *key, const char *name)
+{
+ int ret = !prefixcmp(key, name);
+ return ret;
+}
+
int remote_find_tracking(struct remote *remote, struct refspec *refspec)
{
int find_src = refspec->src == NULL;
if (!fetch->dst)
continue;
if (fetch->pattern) {
- if (!prefixcmp(needle, key)) {
+ if (match_name_with_pattern(key, needle)) {
*result = xmalloc(strlen(value) +
strlen(needle) -
strlen(key) + 1);
continue;
}
- if (rs[i].pattern && !prefixcmp(src->name, rs[i].src))
+ if (rs[i].pattern && match_name_with_pattern(rs[i].src, src->name))
return rs + i;
}
if (matching_refs != -1)
for (ref = remote_refs; ref; ref = ref->next) {
if (strchr(ref->name, '^'))
continue; /* a dereference item */
- if (!prefixcmp(ref->name, refspec->src)) {
+ if (match_name_with_pattern(refspec->src, ref->name)) {
const char *match;
struct ref *cpy = copy_ref(ref);
match = ref->name + remote_prefix_len;