From: Junio C Hamano Date: Fri, 14 Oct 2011 02:03:18 +0000 (-0700) Subject: Merge branch 'nd/maint-sparse-errors' X-Git-Tag: v1.7.8-rc0~90 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=08ec3b5e4d56f62e8585095a7a4bf21721498ef3;p=git.git 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 --- 08ec3b5e4d56f62e8585095a7a4bf21721498ef3 diff --cc t/t1011-read-tree-sparse-checkout.sh index 018c3546b,efcd8abd2..5c0053a20 --- a/t/t1011-read-tree-sparse-checkout.sh +++ b/t/t1011-read-tree-sparse-checkout.sh @@@ -234,4 -234,19 +234,20 @@@ test_expect_success 'read-tree --reset 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