Re: [PATCH 1/7] check_ref_format(): tighten refname rules

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Junio C Hamano <gitster@xxxxxxxxx> writes:

> diff --git a/refs.c b/refs.c
> index 8d3c502..abd5623 100644
> --- a/refs.c
> +++ b/refs.c
> @@ -717,19 +717,23 @@ int check_ref_format(const char *ref)
>  				return CHECK_REF_FORMAT_ERROR;
>  		}
>  
> +		last = ch;
>  		/* scan the rest of the path component */
>  		while ((ch = *cp++) != 0) {
>  			bad_type = bad_ref_char(ch);
> -			if (bad_type) {
> +			if (bad_type)
>  				return CHECK_REF_FORMAT_ERROR;
> -			}
>  			if (ch == '/')
>  				break;
> -			if (ch == '.' && *cp == '.')
> +			if (last == '.' && ch == '.')
> +				return CHECK_REF_FORMAT_ERROR;
> +			if (last == '@' && ch == '{')
>  				return CHECK_REF_FORMAT_ERROR;

Oops; here I need:

+			last = ch;

here.

>  		}
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux