From: Derrick Stolee via GitGitGadget Date: Tue, 24 Aug 2021 21:54:33 GMT Subject: [PATCH 01/13] t1092: behavior for adding sparse files Message-ID: <69ca54877b4eac5c85195a1061f0d72ba6fca313.1629842085.git.gitgitgadget@gmail.com> In-Reply-To: From: Derrick Stolee Add some tests to demonstrate the current behavior around adding files outside of the sparse-checkout cone. Currently, untracked files are handled differently from tracked files. A futuer change will make these cases be handled the same way. Signed-off-by: Derrick Stolee --- t/t1092-sparse-checkout-compatibility.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/t/t1092-sparse-checkout-compatibility.sh b/t/t1092-sparse-checkout-compatibility.sh index bbc6de712c4..23bee918260 100755 --- a/t/t1092-sparse-checkout-compatibility.sh +++ b/t/t1092-sparse-checkout-compatibility.sh @@ -291,6 +291,18 @@ test_expect_success 'add, commit, checkout' ' test_all_match git checkout - ' +# NEEDSWORK: This documents current behavior, but is not a desirable +# behavior (untracked files are handled differently than tracked). +test_expect_success 'add outside sparse cone' ' + init_repos && + + run_on_sparse mkdir folder1 && + run_on_sparse ../edit-contents folder1/a && + run_on_sparse ../edit-contents folder1/newfile && + test_sparse_match test_must_fail git add folder1/a && + test_sparse_match git add folder1/newfile +' + test_expect_success 'commit including unstaged changes' ' init_repos && -- gitgitgadget