| 2054 | " working copy and the content of the index.\n"); |
| 2055 | |
| 2056 | PyObject * |
| 2057 | Repository_reset(Repository *self, PyObject* args) |
| 2058 | { |
| 2059 | PyObject *py_oid; |
| 2060 | git_oid oid; |
| 2061 | git_object *target = NULL; |
| 2062 | int err, reset_type; |
| 2063 | size_t len; |
| 2064 | |
| 2065 | if (!PyArg_ParseTuple(args, "Oi", |
| 2066 | &py_oid, |
| 2067 | &reset_type |
| 2068 | )) |
| 2069 | return NULL; |
| 2070 | |
| 2071 | len = py_oid_to_git_oid(py_oid, &oid); |
| 2072 | if (len == 0) |
| 2073 | return NULL; |
| 2074 | |
| 2075 | err = git_object_lookup_prefix(&target, self->repo, &oid, len, |
| 2076 | GIT_OBJECT_ANY); |
| 2077 | err = err < 0 ? err : git_reset(self->repo, target, reset_type, NULL); |
| 2078 | git_object_free(target); |
| 2079 | if (err < 0) |
| 2080 | return Error_set_oid(err, &oid, len); |
| 2081 | Py_RETURN_NONE; |
| 2082 | } |
| 2083 | |
| 2084 | PyDoc_STRVAR(Repository_free__doc__, |
| 2085 | "free()\n" |
nothing calls this directly
no test coverage detected
searching dependent graphs…