Subject: Re: [PATCH] Add more tests for git-clean

From: Junio C Hamano <[email-masked]>
Date: Sun, 04 Nov 2007 15:35:42 -0800

Shawn Bohrer <[email-masked]> writes:

> +test_expect_success 'git-clean with prefix' '
> +
> +	mkdir -p build docs &&
> +	touch a.out src/part3.c docs/manual.txt obj.o build/lib.so &&
> +	cd src/ &&
> +	git-clean &&
> +	cd - &&

This is wrong for two reasons.

 - Is "cd -" portable?

 - What happens when git-clean fails?  This test fails, and then
   it goes on to the next test without cd'ing back.