Subject: Re: [v3 PATCH 2/2] reset: add tests for git reset -

From: Matthieu Moy <[email-masked]>
Date: Wed, 18 Mar 2015 17:54:16 +0100

Sundararajan R <[email-masked]> writes:

> Subject: [v3 PATCH 2/2] reset: add tests for git reset -

This should be [PATCH v3 2/2].

"git send-email -v2" can do this for you.

Sundararajan R <[email-masked]> writes:

> +test_expect_success 'reset - with no @{-1} branch and file named - should succeed' '
> +	test_when_finished rm -rf new &&
> +	>expected &&
> +	git init new &&
> +	(
> +		cd new &&
> +		echo "Hello" >- &&
> +		git add - &&
> +		git reset - >../actual 
> +	) &&
> +	test_cmp expected actual
> +'

test_must_be_empty actual would be easier to read than ">expected ...
test_cmp expected" IMHO.

> +test_expect_success 'reset - with @{-1} branch and no file named - should succeed' '
> +	test_when_finished rm -rf new &&
> +	git init new &&
> +	(
> +		cd new &&
> +		echo "Hey" >new_file &&
> +		git add new_file &&
> +		git commit -m "first_commit" &&
> +		git checkout -b new_branch &&
> +		>new_file &&
> +		git add new_file &&
> +		git reset - &&
> +		git status -uno >actual &&
> +		git add new_file &&
> +		git reset @{-1} &&
> +		git status -uno >expected &&
> +		test_cmp actual expected 
> +	)
> +'

Better use "git status --porcelain" here as its format is meant to be
stable and unambiguous. The non-porcelain should work two because you're
comparing the output on two identical states, but who knows.

With or without my suggested change, the series looks good to me.

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/