Subject: Re: [PATCH v3 7/7] rm: honor sparse checkout patterns

From: Ævar Arnfjörð Bjarmason <[email-masked]>
Date: Mon, 22 Mar 2021 00:03:00 +0100

On Fri, Mar 12 2021, Matheus Tavares wrote:

> +	test_expect_success "rm${opt:+ $opt} does not remove sparse entries" '
> +		git sparse-checkout set a &&
> +		test_must_fail git rm $opt b 2>stderr &&
> +		test_i18ncmp b_error_and_hint stderr &&
> +		git ls-files --error-unmatch b
> +	'
> +done
> +
> +test_expect_success 'recursive rm does not remove sparse entries' '
> +	git reset --hard &&
> +	git sparse-checkout set sub/dir &&
> +	git rm -r sub &&
> +	git status --porcelain -uno >actual &&
> +	echo "D  sub/dir/e" >expected &&
> +	test_cmp expected actual
> +'
> +
> +test_expect_success 'rm obeys advice.updateSparsePath' '
> +	git reset --hard &&
> +	git sparse-checkout set a &&
> +	test_must_fail git -c advice.updateSparsePath=false rm b 2>stderr &&
> +	test_i18ncmp sparse_entry_b_error stderr

Calls to the test_i18ncmp function should just be test_cmp now. See
1108cea7f8e (tests: remove most uses of test_i18ncmp, 2021-02-11).