Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDerrick Stolee <dstolee@microsoft.com>2021-09-24 18:39:09 +0300
committerJunio C Hamano <gitster@pobox.com>2021-09-28 20:31:02 +0300
commit63b60b3add7527c202124982e0b14a6a512f0450 (patch)
treeb80551785be6bf6118a9c9f1c37a4f5a2fb637f0 /t/t3705-add-sparse-checkout.sh
parent0299a69694fcf486a0880439bb4dacfafe3ffc38 (diff)
add: update --chmod to skip sparse paths
We added checks for path_in_sparse_checkout() to portions of 'git add' that add warnings and prevent staging a modification, but we skipped the --chmod mode. Update chmod_pathspec() to ignore cache entries whose path is outside of the sparse-checkout cone (unless --sparse is provided). Add a test in t3705. Signed-off-by: Derrick Stolee <dstolee@microsoft.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t3705-add-sparse-checkout.sh')
-rwxr-xr-xt/t3705-add-sparse-checkout.sh10
1 files changed, 9 insertions, 1 deletions
diff --git a/t/t3705-add-sparse-checkout.sh b/t/t3705-add-sparse-checkout.sh
index 3cab82092d..0ae674a17a 100755
--- a/t/t3705-add-sparse-checkout.sh
+++ b/t/t3705-add-sparse-checkout.sh
@@ -169,11 +169,19 @@ test_expect_success 'git add fails outside of sparse-checkout definition' '
test_must_fail git add sparse_entry &&
test_sparse_entry_unstaged &&
+ test_must_fail git add --chmod=+x sparse_entry &&
+ test_sparse_entry_unstaged &&
+
# Avoid munging CRLFs to avoid an error message
git -c core.autocrlf=input add --sparse sparse_entry 2>stderr &&
test_must_be_empty stderr &&
test-tool read-cache --table >actual &&
- grep "^100644 blob.*sparse_entry\$" actual
+ grep "^100644 blob.*sparse_entry\$" actual &&
+
+ git add --sparse --chmod=+x sparse_entry 2>stderr &&
+ test_must_be_empty stderr &&
+ test-tool read-cache --table >actual &&
+ grep "^100755 blob.*sparse_entry\$" actual
'
test_expect_success 'add obeys advice.updateSparsePath' '