Subject: Re: [PATCH] git-checkout: Test for relative path use.

From: Johannes Sixt <[email-masked]>
Date: Fri, 09 Nov 2007 08:13:25 +0100

David Symonds schrieb:
> +test_expect_success 'remove and restore with relative path' '
> +
> +	cd dir1 &&
> +	rm ../file0 &&
> +	git checkout HEAD -- ../file0 &&
> +	test "base" = "$(cat ../file0)" &&
> +	rm ../dir2/file2 &&
> +	git checkout HEAD -- ../dir2/file2 &&
> +	test "bonjour" = "$(cat ../dir2/file2)" &&
> +	rm ../file0 ./file1 &&
> +	git checkout HEAD -- .. &&
> +	test "base" = "$(cat ../file0)" &&
> +	test "hello" = "$(cat file1)" &&
> +	cd -

What if this test fails? Then the rest of the tests run from the wrong 
directory. You should put the test in parenthesis (and drop the cd -).

-- Hannes