| 240 | } |
| 241 | |
| 242 | static int |
| 243 | pygit2_refdb_backend_rename(git_reference **out, git_refdb_backend *_be, |
| 244 | const char *old_name, const char *new_name, int force, |
| 245 | const git_signature *_who, const char *message) |
| 246 | { |
| 247 | int err; |
| 248 | PyObject *args, *who; |
| 249 | struct pygit2_refdb_backend *be = (struct pygit2_refdb_backend *)_be; |
| 250 | |
| 251 | if ((who = build_signature(NULL, _who, "utf-8")) != NULL) |
| 252 | return GIT_EUSER; |
| 253 | if ((args = Py_BuildValue("(ssNNs)", old_name, new_name, |
| 254 | force ? Py_True : Py_False, who, message)) == NULL) { |
| 255 | Py_DECREF(who); |
| 256 | return GIT_EUSER; |
| 257 | } |
| 258 | Reference *ref = (Reference *)PyObject_CallObject(be->rename, args); |
| 259 | Py_DECREF(who); |
| 260 | Py_DECREF(args); |
| 261 | |
| 262 | if ((err = git_error_for_exc()) != 0) |
| 263 | return err; |
| 264 | |
| 265 | if (!PyObject_IsInstance((PyObject *)ref, (PyObject *)&ReferenceType)) { |
| 266 | PyErr_SetString(PyExc_TypeError, "Expected object of type pygit2.Reference"); |
| 267 | return GIT_EUSER; |
| 268 | } |
| 269 | |
| 270 | git_reference_dup(out, ref->reference); |
| 271 | Py_DECREF(ref); |
| 272 | return 0; |
| 273 | } |
| 274 | |
| 275 | static int |
| 276 | pygit2_refdb_backend_del(git_refdb_backend *_be, |
nothing calls this directly
no test coverage detected
searching dependent graphs…