From 1153d9f4b6fe2ca44a1fb5ad98b5d8205c41849a Mon Sep 17 00:00:00 2001 From: Victoria Dye Date: Fri, 24 Sep 2021 09:49:46 -0400 Subject: [PATCH] stash: move sparse index test for `stash -u` Move the test for `git stash -u` into the `sparse-index is not expanded` test because it no longer expands the index (temporary or otherwise) when all stashed files are in the sparse checkout definition. Signed-off-by: Victoria Dye --- t/t1092-sparse-checkout-compatibility.sh | 25 +++--------------------- 1 file changed, 3 insertions(+), 22 deletions(-) diff --git a/t/t1092-sparse-checkout-compatibility.sh b/t/t1092-sparse-checkout-compatibility.sh index 0bb27c0b0665a1..59fb94433056a9 100755 --- a/t/t1092-sparse-checkout-compatibility.sh +++ b/t/t1092-sparse-checkout-compatibility.sh @@ -1310,6 +1310,9 @@ test_expect_success 'sparse-index is not expanded' ' ensure_not_expanded stash apply stash@{0} && ensure_not_expanded stash drop stash@{0} && + ensure_not_expanded stash -u && + ensure_not_expanded stash pop && + ensure_not_expanded stash create && oid=$(git -C sparse-index stash create) && ensure_not_expanded stash store -m "test" $oid && @@ -1593,28 +1596,6 @@ test_expect_success 'sparse index is not expanded: sparse-checkout' ' ensure_not_expanded sparse-checkout set ' -# NEEDSWORK: although the full repository's index is _not_ expanded as part of -# stash, a temporary index, which is _not_ sparse, is created when stashing and -# applying a stash of untracked files. As a result, the test reports that it -# finds an instance of `ensure_full_index`, but it does not carry with it the -# performance implications of expanding the full repository index. -test_expect_success 'sparse index is not expanded: stash -u' ' - init_repos && - - mkdir -p sparse-index/folder1 && - echo >>sparse-index/README.md && - echo >>sparse-index/a && - echo >>sparse-index/folder1/new && - - GIT_TRACE2_EVENT="$(pwd)/trace2.txt" GIT_TRACE2_EVENT_NESTING=10 \ - git -C sparse-index stash -u && - test_region index ensure_full_index trace2.txt && - - GIT_TRACE2_EVENT="$(pwd)/trace2.txt" GIT_TRACE2_EVENT_NESTING=10 \ - git -C sparse-index stash pop && - test_region index ensure_full_index trace2.txt -' - # NEEDSWORK: similar to `git add`, untracked files outside of the sparse # checkout definition are successfully stashed and unstashed. test_expect_success 'stash -u outside sparse checkout definition' '