Subject: Re: [PATCH] stash: infer "push" when push-specific options are given

From: Mirko Faina <[email-masked]>
Date: Sat, 4 Apr 2026 17:19:11 +0200

On Sat, Apr 04, 2026 at 02:36:40PM +0000, Deveshi Dwivedi wrote:
> +test_expect_success 'assume push when options imply push' '
> +	git reset --hard &&
> +	echo changed >file &&
> +	git add file &&
> +	git stash -m "implied push" file &&
> +	git stash pop &&
> +
> +	git add file &&
> +	git stash --staged file &&
> +	git stash pop &&
> +
> +	git add file &&
> +	git stash --keep-index file &&
> +	git stash pop &&
> +
> +	echo untracked >untracked-file &&
> +	git stash --include-untracked untracked-file &&
> +	test_path_is_missing untracked-file &&
> +	git stash pop
> +'
> +
>  test_expect_success 'stash --invalid-option' '
>  	echo bar5 >file &&
>  	echo bar6 >file2 &&

The last 'untracked-file' remains in the working tree after the pop. I
know it doesn't affect later tests but can you clean it up anyway? I
recently fixed a test that failed due to poor cleanup and I would like
to see people prevent that too.

Thank you