libgit2/libgit2 — pull request #1378 by jamill (2013-03-01 19:25:28+00:00)
Title: Clone should not clean up directories it did not create

Currently, clone will remove the directory it is cloning to when it fails. This change will cause clone to only clean up directories that it creates.

This does appear to be a slight deviation from core git, where in my testing, it will attempt to remove the directory on clone, even if it didn't create it. However, I think the correct behavior would be to not remote things that you did not create.