MCPcopy Create free account
hub / github.com/libgit2/pygit2 / RefLogIter_iternext

Function RefLogIter_iternext

src/reference.c:56–86  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

54}
55
56PyObject *
57RefLogIter_iternext(RefLogIter *self)
58{
59 const git_reflog_entry *entry;
60 const char * entry_message;
61 RefLogEntry *py_entry;
62 int err;
63
64 if (self->i < self->size) {
65 entry = git_reflog_entry_byindex(self->reflog, self->i);
66 py_entry = PyObject_New(RefLogEntry, &RefLogEntryType);
67 if (py_entry == NULL)
68 return NULL;
69
70 py_entry->oid_old = git_oid_to_python(git_reflog_entry_id_old(entry));
71 py_entry->oid_new = git_oid_to_python(git_reflog_entry_id_new(entry));
72 entry_message = git_reflog_entry_message(entry);
73 py_entry->message = (entry_message != NULL) ? strdup(entry_message) : NULL;
74 err = git_signature_dup(&py_entry->signature,
75 git_reflog_entry_committer(entry));
76 if (err < 0)
77 return Error_set(err);
78
79 ++(self->i);
80
81 return (PyObject*) py_entry;
82 }
83
84 PyErr_SetNone(PyExc_StopIteration);
85 return NULL;
86}
87
88
89PyDoc_STRVAR(RefLogIterType__doc__, "Internal reflog iterator object.");

Callers

nothing calls this directly

Calls 2

git_oid_to_pythonFunction · 0.85
Error_setFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…