]> git.ipfire.org Git - thirdparty/git.git/commit
mv: check if <destination> exists in index to handle overwriting
authorShaoxuan Yuan <shaoxuan.yuan02@gmail.com>
Thu, 30 Jun 2022 02:37:35 +0000 (10:37 +0800)
committerJunio C Hamano <gitster@pobox.com>
Fri, 1 Jul 2022 21:50:16 +0000 (14:50 -0700)
commit8a26a3915fbe1aab9786b28c535c8541f8df2a19
treefc82c77a720b5cef9bbd6bcb28ffea472e1da9d0
parent6645b03ca5af33bbce1001257ee22832559ec966
mv: check if <destination> exists in index to handle overwriting

Originally, moving a sparse file into cone can result in unwarned
overwrite of existing entry. The expected behavior is that if the
<destination> exists in the entry, user should be prompted to supply
a [-f|--force] to carry out the operation, or the operation should
fail.

Add a check mechanism to do that.

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