summaryrefslogtreecommitdiff
path: root/remote.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2012-11-15 10:22:54 -0800
committerJunio C Hamano <gitster@pobox.com>2012-11-15 10:22:54 -0800
commit7115d3cc2b06364645dbfbbb0b8b7d49315566e2 (patch)
tree89ce02657e1db8a5d96f75e8f3087b7a0f079e1c /remote.c
parentb0b00a3ee43b4813eb85728a482500f6422499fd (diff)
parent5c08c1f23ad512fbcd06f4ee9bcf8818e17a2627 (diff)
downloadgit-7115d3cc2b06364645dbfbbb0b8b7d49315566e2.tar.gz
Merge branch 'jc/maint-fetch-tighten-refname-check'
For a fetch refspec (or the result of applying wildcard on one), we always want the RHS to map to something inside "refs/" hierarchy. This was split out from discarded jc/maint-push-refs-all topic. * jc/maint-fetch-tighten-refname-check: get_fetch_map(): tighten checks on dest refs
Diffstat (limited to 'remote.c')
-rw-r--r--remote.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/remote.c b/remote.c
index 04fd9ea4bd..5882d11a8d 100644
--- a/remote.c
+++ b/remote.c
@@ -1458,8 +1458,8 @@ int get_fetch_map(const struct ref *remote_refs,
for (rmp = &ref_map; *rmp; ) {
if ((*rmp)->peer_ref) {
- if (check_refname_format((*rmp)->peer_ref->name + 5,
- REFNAME_ALLOW_ONELEVEL)) {
+ if (prefixcmp((*rmp)->peer_ref->name, "refs/") ||
+ check_refname_format((*rmp)->peer_ref->name, 0)) {
struct ref *ignore = *rmp;
error("* Ignoring funny ref '%s' locally",
(*rmp)->peer_ref->name);