| 316 | }; |
| 317 | |
| 318 | PyObject * |
| 319 | build_signature(Object *obj, const git_signature *signature, |
| 320 | const char *encoding) |
| 321 | { |
| 322 | Signature *py_signature; |
| 323 | |
| 324 | py_signature = PyObject_New(Signature, &SignatureType); |
| 325 | if (!py_signature) |
| 326 | goto on_error; |
| 327 | |
| 328 | py_signature->encoding = NULL; |
| 329 | if (encoding) { |
| 330 | py_signature->encoding = strdup(encoding); |
| 331 | if (!py_signature->encoding) |
| 332 | goto on_error; |
| 333 | } |
| 334 | |
| 335 | Py_XINCREF(obj); |
| 336 | py_signature->obj = obj; |
| 337 | py_signature->signature = signature; |
| 338 | |
| 339 | return (PyObject*)py_signature; |
| 340 | |
| 341 | on_error: |
| 342 | git_signature_free((git_signature *) signature); |
| 343 | return NULL; |
| 344 | } |
no outgoing calls
no test coverage detected
searching dependent graphs…