From: Junio C Hamano Date: Tue, 08 Aug 2023 19:00:53 GMT Subject: Re: [PATCH] fix `git mv existing-dir non-existing-dir`* Message-ID: In-Reply-To: Junio C Hamano writes: > 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.