only use error message if giterr_last() is not null

exptected errors in libgit2 must not set a git_error.
This commit is contained in:
Nico von Geyso
2012-11-22 15:47:53 +01:00
parent dbf468b2ec
commit 6b3607cf95

View File

@@ -113,6 +113,9 @@ PyObject* Error_set_str(int err, const char *str)
}
error = giterr_last();
if (error == NULL) //exptected error - no error msg set
return PyErr_Format(Error_type(err), "%s", str);
return PyErr_Format(Error_type(err), "%s: %s", str, error->message);
}