Subject: Re: [PATCH] t1402-check-ref-format: skip tests of refs beginning with slash on Windows

From: Junio C Hamano <[email-masked]>
Date: Thu, 13 Oct 2011 16:00:04 -0700

Johannes Sixt <[email-masked]> writes:

> This patch is needed on top of mh/check-ref-format-3, or it could be
> inserted in front of this batch (which probably amounts to the same
> thing :-)

How about applying directly on 'master' then?

> +invalid_ref NOT_MINGW '/'
> ...
> @@ -155,21 +155,21 @@ test_expect_success 'check-ref-format --branch from subdir' '
>  '
>  
>  valid_ref_normalized() {
> -	test_expect_success "ref name '$1' simplifies to '$2'" "
> +	test_expect_success $3 "ref name '$1' simplifies to '$2'" "
>  		refname=\$(git check-ref-format --normalize '$1') &&
>  		test \"\$refname\" = '$2'"
>  }
>  invalid_ref_normalized() {
> -	test_expect_success "check-ref-format --normalize rejects '$1'" "
> +	test_expect_success $2 "check-ref-format --normalize rejects '$1'" "
>  		test_must_fail git check-ref-format --normalize '$1'"
>  }
> ...
> +valid_ref_normalized '/heads/foo' 'heads/foo' NOT_MINGW

The inconsistencies strikes me a bit.

Perhaps update to something like this?

	valid_ref_normalized () {
		if test $# = 3
                then
			prereq=$1
                        shift
		fi
                test_expect_success $prereq "ref name '$1' simplifies to '$2'"
		...
	}