Re: [PATCH v2 1/9] t7002: add tests for moving from in-cone to out-of-cone
- From
Shaoxuan Yuan <shaoxuan.yuan02@gmail.com>
- Date
- Aug 9, 2022, 11:24 UTC
- Message-ID
- <3c4ee06e-1145-8efc-ddb9-eeaed81079f5@gmail.com>
- In-Reply-To
- <651d89e2-5282-2cf8-ffc3-8650a023c80a@gmail.com>
On 8/9/2022 10:55 AM, Shaoxuan Yuan wrote: >> 2. Move a (clean or dirty) in-cone source directory to an out-of-cone >> destination where one or more files in <src> overwrite files in <dst>. >> For example, something like: >> >> echo test >sub/dir/file1 && >> git add sub/dir/file1 && >> git mv --sparse sub/dir folder1 >> >> I don't have a strong opinion on the behavior (does it fail the whole >> 'mv' operation? move everything except the files that overwrite >> something?), but it would help to have it documented via test here. > OK. I think it will fail the whole `mv` operation. The program will report unspecified > overwrite during the early checking phase. The actual "moving" phase won't be touched > at all because Git complains early.
No, actually this example does not fail anything. Because "sub/dir/file1" after the move will be "folder1/dir/file1", and this move does not involve overwrite at all.
I'm still adding a test case that precisely reflects the main idea here, though. Thanks for the suggestion :)
-- Thanks, Shaoxuan