]> git.ipfire.org Git - thirdparty/git.git/commit
t7002: add tests for moving from in-cone to out-of-cone
authorShaoxuan Yuan <shaoxuan.yuan02@gmail.com>
Tue, 9 Aug 2022 12:09:02 +0000 (20:09 +0800)
committerJunio C Hamano <gitster@pobox.com>
Wed, 10 Aug 2022 20:57:48 +0000 (13:57 -0700)
commit5506683deaab4c1475800e9b4cd2c06b8de4de97
treed8cf8a52104f545e744a2a111609ed2540182de8
parentb91a2b6594a1da7d4d2f936f7db25bfa5a3d775e
t7002: add tests for moving from in-cone to out-of-cone

Add corresponding tests to test that user can move an in-cone <source>
to out-of-cone <destination> when --sparse is supplied.

Such <source> can be either clean or dirty, and moving it results in
different behaviors:

A clean move should move <source> to <destination> in the index (do
*not* create <destination> in the worktree), then delete <source> from
the worktree.

A dirty move should move the <source> to the <destination>, both in the
working tree and the index, but should *not* remove the resulted path
from the working tree and should *not* turn on its CE_SKIP_WORKTREE bit.

Also make sure that if <destination> exists in the index (existing
check for if <destination> is in the worktree is not enough in
in-to-out moves), warn user against the overwrite. And Git should force
the overwrite when supplied with -f or --force.

Helped-by: Derrick Stolee <derrickstolee@github.com>
Helped-by: Victoria Dye <vdye@github.com>
Signed-off-by: Shaoxuan Yuan <shaoxuan.yuan02@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t7002-mv-sparse-checkout.sh