libgit2/objective-git — pull request #234 by diederich (2013-07-19 13:51:18+00:00)
Title: add test case for crash in error creation

We're seeing a crashing bug when opening a repository with spaces. I've traced it down to the error creation.
This PR adds a testcase for this crash, but does _NOT_ fix it.

What I found out about this crash:
https://github.com/libgit2/objective-git/blob/master/Classes/Categories/NSError%2BGit.m#L43 calls
https://github.com/libgit2/objective-git/blob/master/Classes/Categories/NSError%2BGit.m#L49 with reason set to NIL.
If the format string ('desc') contains format specifiers, e.g. from a file path with spaces, [[NSString alloc] initWithFormat:desc arguments:args] crashes (actually the crash is a bit [later](https://github.com/libgit2/objective-git/blob/master/Classes/Categories/NSError%2BGit.m#L60) probably because it's lazily evaluated).

The added test case reproduces the crash, though I'm not sure how to fix it as I'm not really comfortable with the var_args stuff.
Is it a good idea to do unfold var_args a second time, where the format specifier isn't passed in from the user?

//cc @tiennou