| 219 | } |
| 220 | |
| 221 | int Branch_upstream__set__(Branch *self, Reference *py_ref) |
| 222 | { |
| 223 | int err; |
| 224 | const char *branch_name = NULL; |
| 225 | |
| 226 | CHECK_REFERENCE_INT(self); |
| 227 | |
| 228 | if ((PyObject *)py_ref != Py_None) { |
| 229 | if (!PyObject_TypeCheck(py_ref, (PyTypeObject *)&ReferenceType)) { |
| 230 | PyErr_SetObject(PyExc_TypeError, (PyObject *)py_ref); |
| 231 | return -1; |
| 232 | } |
| 233 | |
| 234 | CHECK_REFERENCE_INT(py_ref); |
| 235 | err = git_branch_name(&branch_name, py_ref->reference); |
| 236 | if (err < GIT_OK) { |
| 237 | Error_set(err); |
| 238 | return -1; |
| 239 | } |
| 240 | } |
| 241 | |
| 242 | err = git_branch_set_upstream(self->reference, branch_name); |
| 243 | if (err < GIT_OK) { |
| 244 | Error_set(err); |
| 245 | return -1; |
| 246 | } |
| 247 | |
| 248 | return 0; |
| 249 | } |
| 250 | |
| 251 | |
| 252 | PyDoc_STRVAR(Branch_upstream_name__doc__, |
nothing calls this directly
no test coverage detected
searching dependent graphs…