| 61 | } |
| 62 | |
| 63 | int |
| 64 | Tree_contains(Tree *self, PyObject *py_name) |
| 65 | { |
| 66 | if (Object__load((Object*)self) == NULL) { return -1; } // Lazy load |
| 67 | |
| 68 | PyObject *tvalue; |
| 69 | char *name = pgit_borrow_fsdefault(py_name, &tvalue); |
| 70 | if (name == NULL) |
| 71 | return -1; |
| 72 | |
| 73 | git_tree_entry *entry; |
| 74 | int err = git_tree_entry_bypath(&entry, self->tree, name); |
| 75 | Py_DECREF(tvalue); |
| 76 | |
| 77 | if (err == GIT_ENOTFOUND) { |
| 78 | return 0; |
| 79 | } else if (err < 0) { |
| 80 | Error_set(err); |
| 81 | return -1; |
| 82 | } |
| 83 | |
| 84 | git_tree_entry_free(entry); |
| 85 | |
| 86 | return 1; |
| 87 | } |
| 88 | |
| 89 | int |
| 90 | Tree_fix_index(const git_tree *tree, PyObject *py_index) |
nothing calls this directly
no test coverage detected
searching dependent graphs…