Junio C Hamano [off-list ref] 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.