Re: [PATCH] fix `git mv existing-dir non-existing-dir`*
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Aug 8, 2023, 19:00 UTC
- Message-ID
- <xmqqttt9740q.fsf@gitster.g>
- In-Reply-To
- <xmqqy1il77wp.fsf@gitster.g>
Junio C Hamano <gitster@pobox.com> writes:
Show 13 quoted lines
> What is curious is that dest_st.st_mode, after lstat on dst > succeeds, is never checked, even though the error message claims > that it detected an attempt to move directory over file. What > should happen when the user did this then? > > $ git mv existing-dir another-existing-dir > > Shouldn't it do something similar to > > $ mv D1 D2 > > which is to move the entire hierarchy of D1 and make it appear at > D2/D1?
Ah, that case is handled in a different codepath, so this lstat of dst needs to check only the existence. So there is no (unrelated) bug there. Sorry for the noise.