libgit2/libgit2 — pull request #1635 by arrbee (2013-06-05 19:09:03+00:00)
Title: Simplify git_futils_mkdir

This routine was (is) pretty complicated, but given the recent changes, it seemed like it could be simplified a bit.

What I decided is that the specific error from `p_mkdir` doesn't really matter. If we get an error from that routine, then we'll always stat the path we attempted to create and see if it is already a directory and continue if so (provided `GIT_MKDIR_EXCL` isn't being used). I also use that stat data to avoid a chmod if it isn't needed. And lastly, I shifted where the final stat for `GIT_MKDIR_VERIFY_DIR` is done so that even if we skip over a leading drive letter or network mount point, we'll still verify that the location is an actual existing directory.

The bottom line is that this reduces the amount of code and, I think, makes it easier to follow. You have have to view the result instead of just viewing the diffs to be able to follow the changes. This is a place where side-by-side would really help.