summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pathspec.c2
-rwxr-xr-xt/t1092-sparse-checkout-compatibility.sh7
2 files changed, 3 insertions, 6 deletions
diff --git a/pathspec.c b/pathspec.c
index 08f8d3eedc..44306fdaca 100644
--- a/pathspec.c
+++ b/pathspec.c
@@ -37,8 +37,6 @@ void add_pathspec_matches_against_index(const struct pathspec *pathspec,
num_unmatched++;
if (!num_unmatched)
return;
- /* TODO: audit for interaction with sparse-index. */
- ensure_full_index(istate);
for (i = 0; i < istate->cache_nr; i++) {
const struct cache_entry *ce = istate->cache[i];
if (sw_action == PS_IGNORE_SKIP_WORKTREE && ce_skip_worktree(ce))
diff --git a/t/t1092-sparse-checkout-compatibility.sh b/t/t1092-sparse-checkout-compatibility.sh
index 77343cb6d9..dee20db5bb 100755
--- a/t/t1092-sparse-checkout-compatibility.sh
+++ b/t/t1092-sparse-checkout-compatibility.sh
@@ -322,9 +322,6 @@ test_expect_success 'commit including unstaged changes' '
test_expect_success 'status/add: outside sparse cone' '
init_repos &&
- # adding a "missing" file outside the cone should fail
- test_sparse_match test_must_fail git add folder1/a &&
-
# folder1 is at HEAD, but outside the sparse cone
run_on_sparse mkdir folder1 &&
cp initial-repo/folder1/a sparse-checkout/folder1/a &&
@@ -652,7 +649,9 @@ test_expect_success 'sparse-index is not expanded' '
echo >>sparse-index/README.md &&
ensure_not_expanded add -A &&
echo >>sparse-index/extra.txt &&
- ensure_not_expanded add extra.txt
+ ensure_not_expanded add extra.txt &&
+ echo >>sparse-index/untracked.txt &&
+ ensure_not_expanded add .
'
# NEEDSWORK: a sparse-checkout behaves differently from a full checkout