Skip to content

Commit

Permalink
Merge branch 'jc/maint-fetch-tighten-refname-check'
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Junio C Hamano committed Nov 15, 2012
2 parents b0b00a3 + 5c08c1f commit 7115d3c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions remote.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 7115d3c

Please sign in to comment.