| 198 | PyDoc_STRVAR(Commit_tree__doc__, "The tree object attached to the commit."); |
| 199 | |
| 200 | PyObject * |
| 201 | Commit_tree__get__(Commit *self) |
| 202 | { |
| 203 | git_tree *tree; |
| 204 | |
| 205 | if (Object__load((Object*)self) == NULL) { return NULL; } // Lazy load |
| 206 | |
| 207 | int err = git_commit_tree(&tree, self->commit); |
| 208 | if (err == GIT_ENOTFOUND) { |
| 209 | char tree_id[GIT_OID_HEXSZ + 1] = { 0 }; |
| 210 | git_oid_fmt(tree_id, git_commit_tree_id(self->commit)); |
| 211 | return PyErr_Format(GitError, "Unable to read tree %s", tree_id); |
| 212 | } |
| 213 | |
| 214 | if (err < 0) |
| 215 | return Error_set(err); |
| 216 | |
| 217 | return wrap_object((git_object*)tree, self->repo, NULL); |
| 218 | } |
| 219 | |
| 220 | PyDoc_STRVAR(Commit_tree_id__doc__, "The id of the tree attached to the commit."); |
| 221 |
nothing calls this directly
no test coverage detected
searching dependent graphs…