summaryrefslogtreecommitdiff
path: root/t/t1011-read-tree-sparse-checkout.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2011-10-13 19:03:18 -0700
committerJunio C Hamano <gitster@pobox.com>2011-10-13 19:03:18 -0700
commit08ec3b5e4d56f62e8585095a7a4bf21721498ef3 (patch)
tree223897ffe752aa0955c5dc56bfe10692c9eabf9a /t/t1011-read-tree-sparse-checkout.sh
parent34c4461ae3b353e8c931565d5527b98ed12e3735 (diff)
parenta7bc906f2e64f0d9d3fec91964dc38e390ef69a1 (diff)
downloadgit-08ec3b5e4d56f62e8585095a7a4bf21721498ef3.tar.gz
Merge branch 'nd/maint-sparse-errors'
* nd/maint-sparse-errors: Add explanation why we do not allow to sparse checkout to empty working tree sparse checkout: show error messages when worktree shaping fails
Diffstat (limited to 't/t1011-read-tree-sparse-checkout.sh')
-rwxr-xr-xt/t1011-read-tree-sparse-checkout.sh16
1 files changed, 16 insertions, 0 deletions
diff --git a/t/t1011-read-tree-sparse-checkout.sh b/t/t1011-read-tree-sparse-checkout.sh
index 018c3546b6..5c0053a20b 100755
--- a/t/t1011-read-tree-sparse-checkout.sh
+++ b/t/t1011-read-tree-sparse-checkout.sh
@@ -234,4 +234,20 @@ test_expect_success 'read-tree --reset removes outside worktree' '
test_cmp empty result
'
+test_expect_success 'print errors when failed to update worktree' '
+ echo sub >.git/info/sparse-checkout &&
+ git checkout -f init &&
+ mkdir sub &&
+ touch sub/added sub/addedtoo &&
+ test_must_fail git checkout top 2>actual &&
+ cat >expected <<\EOF &&
+error: The following untracked working tree files would be overwritten by checkout:
+ sub/added
+ sub/addedtoo
+Please move or remove them before you can switch branches.
+Aborting
+EOF
+ test_cmp expected actual
+'
+
test_done