Skip to content

Commit 8b83ef8

Browse files
committed
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 <[email protected]>
1 parent 0e01d41 commit 8b83ef8

File tree

1 file changed

+3
-22
lines changed

1 file changed

+3
-22
lines changed

t/t1092-sparse-checkout-compatibility.sh

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1185,6 +1185,9 @@ test_expect_success 'sparse-index is not expanded' '
11851185
ensure_not_expanded stash apply stash@{0} &&
11861186
ensure_not_expanded stash drop stash@{0} &&
11871187
1188+
ensure_not_expanded stash -u &&
1189+
ensure_not_expanded stash pop &&
1190+
11881191
ensure_not_expanded stash create &&
11891192
oid=$(git -C sparse-index stash create) &&
11901193
ensure_not_expanded stash store -m "test" $oid &&
@@ -1301,28 +1304,6 @@ test_expect_success 'sparse index is not expanded: read-tree' '
13011304
ensure_not_expanded read-tree --prefix=deep/deeper2 -u deepest
13021305
'
13031306

1304-
# NEEDSWORK: although the full repository's index is _not_ expanded as part of
1305-
# stash, a temporary index, which is _not_ sparse, is created when stashing and
1306-
# applying a stash of untracked files. As a result, the test reports that it
1307-
# finds an instance of `ensure_full_index`, but it does not carry with it the
1308-
# performance implications of expanding the full repository index.
1309-
test_expect_success 'sparse index is not expanded: stash -u' '
1310-
init_repos &&
1311-
1312-
mkdir -p sparse-index/folder1 &&
1313-
echo >>sparse-index/README.md &&
1314-
echo >>sparse-index/a &&
1315-
echo >>sparse-index/folder1/new &&
1316-
1317-
GIT_TRACE2_EVENT="$(pwd)/trace2.txt" GIT_TRACE2_EVENT_NESTING=10 \
1318-
git -C sparse-index stash -u &&
1319-
test_region index ensure_full_index trace2.txt &&
1320-
1321-
GIT_TRACE2_EVENT="$(pwd)/trace2.txt" GIT_TRACE2_EVENT_NESTING=10 \
1322-
git -C sparse-index stash pop &&
1323-
test_region index ensure_full_index trace2.txt
1324-
'
1325-
13261307
# NEEDSWORK: similar to `git add`, untracked files outside of the sparse
13271308
# checkout definition are successfully stashed and unstashed.
13281309
test_expect_success 'stash -u outside sparse checkout definition' '

0 commit comments

Comments
 (0)