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

Function Repository_head__get__

src/repository.c:212–229  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

210 "Current head reference of the repository.");
211
212PyObject *
213Repository_head__get__(Repository *self)
214{
215 git_reference *head;
216 int err;
217
218 err = git_repository_head(&head, self->repo);
219 if (err < 0) {
220 if (err == GIT_ENOTFOUND)
221 PyErr_SetString(GitError, "head reference does not exist");
222 else
223 Error_set(err);
224
225 return NULL;
226 }
227
228 return wrap_reference(head, self);
229}
230
231PyDoc_STRVAR(Repository_head_is_detached__doc__,
232 "A repository's HEAD is detached when it points directly to a commit\n"

Callers

nothing calls this directly

Calls 2

Error_setFunction · 0.85
wrap_referenceFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…