author | Junio C Hamano <gitster@pobox.com> | |
Fri, 14 Oct 2011 02:03:18 +0000 (19:03 -0700) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Fri, 14 Oct 2011 02:03:18 +0000 (19:03 -0700) |
* 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
Add explanation why we do not allow to sparse checkout to empty working tree
sparse checkout: show error messages when worktree shaping fails
1 | 2 | |||
---|---|---|---|---|
t/t1011-read-tree-sparse-checkout.sh | patch | | diff1 | | diff2 | | blob | history |
unpack-trees.c | patch | | diff1 | | diff2 | | blob | history |
diff --cc t/t1011-read-tree-sparse-checkout.sh
index 018c3546b6f05228a20dfb5ec9364d0a1575e4ff,efcd8abd2f97458cfe06900d1723910bc59ac6dc..5c0053a20bf2fbf1dd466ace5dc933e38ce3544d
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
diff --cc unpack-trees.c
Simple merge