Re: [PATCH v3 7/7] rm: honor sparse checkout patterns
- From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
- Date
- Mar 21, 2021, 23:03 UTC
- Message-ID
- <87h7l4qfdn.fsf@evledraar.gmail.com>
- In-Reply-To
- <d25ea10560b501d2ca77b567927a0bb9bc874a1e.1615588109.git.matheus.bernardino@usp.br>
On Fri, Mar 12 2021, Matheus Tavares wrote:
Show 22 quoted lines
> + 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 stderrCalls to the test_i18ncmp function should just be test_cmp now. See 1108cea7f8e (tests: remove most uses of test_i18ncmp, 2021-02-11).