aboutsummaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2013-04-22 11:11:40 -0700
committerJunio C Hamano <gitster@pobox.com>2013-04-22 11:11:40 -0700
commitde0d774d46b3731ea22567efc4aaf1fc8f5ac919 (patch)
tree68eac5271a875809dd3f0da358d0901f267c882c /t
parent703319313fc2878c0c28ccc14a488024e8687fc2 (diff)
parent08d595dc1cdf6f0d8e6022a69c4fcdd2fba628cf (diff)
downloadgit-de0d774d46b3731ea22567efc4aaf1fc8f5ac919.tar.gz
git-de0d774d46b3731ea22567efc4aaf1fc8f5ac919.tar.xz
Merge branch 'nd/checkout-keep-sparse'
Make the initial "sparse" selection of the paths more sticky across "git checkout". * nd/checkout-keep-sparse: checkout: add --ignore-skip-worktree-bits in sparse checkout mode
Diffstat (limited to 't')
-rwxr-xr-xt/t1011-read-tree-sparse-checkout.sh24
-rwxr-xr-xt/t3001-ls-files-others-exclude.sh2
2 files changed, 25 insertions, 1 deletions
diff --git a/t/t1011-read-tree-sparse-checkout.sh b/t/t1011-read-tree-sparse-checkout.sh
index 5c0053a20..0c74beedd 100755
--- a/t/t1011-read-tree-sparse-checkout.sh
+++ b/t/t1011-read-tree-sparse-checkout.sh
@@ -250,4 +250,28 @@ EOF
test_cmp expected actual
'
+test_expect_success 'checkout without --ignore-skip-worktree-bits' '
+ echo "*" >.git/info/sparse-checkout &&
+ git checkout -f top &&
+ test_path_is_file init.t &&
+ echo sub >.git/info/sparse-checkout &&
+ git checkout &&
+ echo modified >> sub/added &&
+ git checkout . &&
+ test_path_is_missing init.t &&
+ git diff --exit-code HEAD
+'
+
+test_expect_success 'checkout with --ignore-skip-worktree-bits' '
+ echo "*" >.git/info/sparse-checkout &&
+ git checkout -f top &&
+ test_path_is_file init.t &&
+ echo sub >.git/info/sparse-checkout &&
+ git checkout &&
+ echo modified >> sub/added &&
+ git checkout --ignore-skip-worktree-bits . &&
+ test_path_is_file init.t &&
+ git diff --exit-code HEAD
+'
+
test_done
diff --git a/t/t3001-ls-files-others-exclude.sh b/t/t3001-ls-files-others-exclude.sh
index efb7ebc91..2d274bf8f 100755
--- a/t/t3001-ls-files-others-exclude.sh
+++ b/t/t3001-ls-files-others-exclude.sh
@@ -103,7 +103,7 @@ test_expect_success \
test_cmp expect output'
test_expect_success 'restore gitignore' '
- git checkout $allignores &&
+ git checkout --ignore-skip-worktree-bits $allignores &&
rm .git/index
'