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
This commit is contained in:
Junio C Hamano
2011-10-13 19:03:18 -07:00
2 changed files with 32 additions and 4 deletions

View File

@ -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