diff options
author | Junio C Hamano <gitster@pobox.com> | 2009-03-20 14:30:00 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2009-03-20 14:30:00 -0700 |
commit | 8e50ada5530c6bc937c5a7c10130b2b09f1389f2 (patch) | |
tree | 09d3b7d36847ec819a261d7a285032679617e9b1 /builtin-remote.c | |
parent | Merge branch 'jc/clone-branch-rebase' (diff) | |
parent | Adjust js/remote-improvements and db/refspec-wildcard-in-the-middle (diff) | |
download | tgif-8e50ada5530c6bc937c5a7c10130b2b09f1389f2.tar.xz |
Merge branch 'xx/db-refspec-vs-js-remote'
* xx/db-refspec-vs-js-remote:
Support '*' in the middle of a refspec
Keep '*' in pattern refspecs
Use the matching function to generate the match results
Use a single function to match names against patterns
Make clone parse the default refspec with the normal code
Diffstat (limited to 'builtin-remote.c')
-rw-r--r-- | builtin-remote.c | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/builtin-remote.c b/builtin-remote.c index e445b8ba38..993acd6a09 100644 --- a/builtin-remote.c +++ b/builtin-remote.c @@ -358,14 +358,9 @@ static int get_push_ref_states_noquery(struct ref_states *states) } for (i = 0; i < remote->push_refspec_nr; i++) { struct refspec *spec = remote->push + i; - char buf[PATH_MAX]; if (spec->matching) item = string_list_append("(matching)", &states->push); - else if (spec->pattern) { - snprintf(buf, (sizeof(buf)), "%s*", spec->src); - item = string_list_append(buf, &states->push); - snprintf(buf, (sizeof(buf)), "%s*", spec->dst); - } else if (strlen(spec->src)) + else if (strlen(spec->src)) item = string_list_append(spec->src, &states->push); else item = string_list_append("(delete)", &states->push); @@ -373,10 +368,7 @@ static int get_push_ref_states_noquery(struct ref_states *states) info = item->util = xcalloc(sizeof(struct push_info), 1); info->forced = spec->force; info->status = PUSH_STATUS_NOTQUERIED; - if (spec->pattern) - info->dest = xstrdup(buf); - else - info->dest = xstrdup(spec->dst ? spec->dst : item->string); + info->dest = xstrdup(spec->dst ? spec->dst : item->string); } return 0; } @@ -389,7 +381,7 @@ static int get_head_names(const struct ref *remote_refs, struct ref_states *stat refspec.force = 0; refspec.pattern = 1; - refspec.src = refspec.dst = "refs/heads/"; + refspec.src = refspec.dst = "refs/heads/*"; states->heads.strdup_strings = 1; get_fetch_map(remote_refs, &refspec, &fetch_map_tail, 0); matches = guess_remote_head(find_ref_by_name(remote_refs, "HEAD"), |