| 205 | } |
| 206 | |
| 207 | static int |
| 208 | pygit2_refdb_backend_write(git_refdb_backend *_be, |
| 209 | const git_reference *_ref, int force, |
| 210 | const git_signature *_who, const char *message, |
| 211 | const git_oid *_old, const char *old_target) |
| 212 | { |
| 213 | int err; |
| 214 | PyObject *args = NULL, *ref = NULL, *who = NULL, *old = NULL; |
| 215 | struct pygit2_refdb_backend *be = (struct pygit2_refdb_backend *)_be; |
| 216 | |
| 217 | // XXX: Drops const |
| 218 | if ((ref = wrap_reference((git_reference *)_ref, NULL)) == NULL) |
| 219 | goto euser; |
| 220 | if ((who = build_signature(NULL, _who, "utf-8")) == NULL) |
| 221 | goto euser; |
| 222 | if ((old = git_oid_to_python(_old)) == NULL) |
| 223 | goto euser; |
| 224 | if ((args = Py_BuildValue("(NNNsNs)", ref, |
| 225 | force ? Py_True : Py_False, |
| 226 | who, message, old, old_target)) == NULL) |
| 227 | goto euser; |
| 228 | |
| 229 | PyObject_CallObject(be->write, args); |
| 230 | err = git_error_for_exc(); |
| 231 | out: |
| 232 | Py_DECREF(ref); |
| 233 | Py_DECREF(who); |
| 234 | Py_DECREF(old); |
| 235 | Py_DECREF(args); |
| 236 | return err; |
| 237 | euser: |
| 238 | err = GIT_EUSER; |
| 239 | goto out; |
| 240 | } |
| 241 | |
| 242 | static int |
| 243 | pygit2_refdb_backend_rename(git_reference **out, git_refdb_backend *_be, |
nothing calls this directly
no test coverage detected
searching dependent graphs…