| 103 | |
| 104 | |
| 105 | PyObject * |
| 106 | Error_set_str(int err, const char *str) |
| 107 | { |
| 108 | if (err == GIT_ENOTFOUND) { |
| 109 | /* KeyError expects the arg to be the missing key. */ |
| 110 | PyErr_SetString(PyExc_KeyError, str); |
| 111 | return NULL; |
| 112 | } |
| 113 | |
| 114 | const git_error *error = git_error_last(); |
| 115 | if (error == NULL) /* Expected error - no error msg set */ |
| 116 | return PyErr_Format(Error_type(err), "%s", str); |
| 117 | |
| 118 | return PyErr_Format(Error_type(err), "%s: %s", str, error->message); |
| 119 | } |
| 120 | |
| 121 | PyObject * |
| 122 | Error_set_oid(int err, const git_oid *oid, size_t len) |
no test coverage detected
searching dependent graphs…