From: Junio C Hamano <hidden> Date: 2016-06-15 22:43:27
Junio C Hamano [off-list ref] writes:
Actually that will break the case of removing foo/bar, which is
the only file in directory foo, and creating a new file foo.
Sorry. The creation codepath already has enough code to remove
the left-over directory foo/ when creating the file foo. I
think your three-step process should be Ok.