diff options
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2011-09-22 21:24:22 +1000 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2011-09-22 11:35:44 -0700 |
commit | 17d26a4d0485229c24b649013a40d5928ba223cc (patch) | |
tree | cfb5da4ebf1e1a101a57b7bd679aa58f912800cf /t/t1011-read-tree-sparse-checkout.sh | |
parent | f696543dad6c7ba27b0c4fab167a5687263a9ba0 (diff) | |
download | git-17d26a4d0485229c24b649013a40d5928ba223cc.tar.gz git-17d26a4d0485229c24b649013a40d5928ba223cc.tar.xz |
sparse checkout: show error messages when worktree shaping fails
verify_* functions can queue errors up and to be printed later at
label return_failed. In case of errors, do not go to label "done"
directly because all queued messages would be dropped on the floor.
Found-by: Joshua Jensen <jjensen@workspacewhiz.com>
Tracked-down-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t1011-read-tree-sparse-checkout.sh')
-rwxr-xr-x | t/t1011-read-tree-sparse-checkout.sh | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/t/t1011-read-tree-sparse-checkout.sh b/t/t1011-read-tree-sparse-checkout.sh index 018c3546b..efcd8abd2 100755 --- a/t/t1011-read-tree-sparse-checkout.sh +++ b/t/t1011-read-tree-sparse-checkout.sh @@ -234,4 +234,19 @@ 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. +EOF + test_cmp expected actual +' + test_done |