libgit2 / objective-git

Objective-C bindings to libgit2
MIT License
1.16k stars 280 forks source link

Fixes crash caused by GTRepository dealloc #690

Open arguiot opened 5 years ago

arguiot commented 5 years ago

When the system calls -[GTRepository dealloc] and the git_repository is empty, but still exists, the app crashes.

Here is a screenshot of the debug session:

Capture d’écran 2019-05-16 à 20 27 09

To fix this, the function is simply checking if the workdir property of the git_repository object isn't empty before cleaning the repo.

This PR fixes #689