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

Function Repository_create_note

src/repository.c:1986–2013  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1984 "If no ref is given 'refs/notes/commits' will be used.");
1985
1986PyObject *
1987Repository_create_note(Repository *self, PyObject* args)
1988{
1989 git_oid note_id, annotated_id;
1990 char *annotated = NULL, *message = NULL, *ref = "refs/notes/commits";
1991 int err = GIT_ERROR;
1992 unsigned int force = 0;
1993 Signature *py_author, *py_committer;
1994
1995 if (!PyArg_ParseTuple(args, "sO!O!s|si",
1996 &message,
1997 &SignatureType, &py_author,
1998 &SignatureType, &py_committer,
1999 &annotated, &ref, &force))
2000 return NULL;
2001
2002 err = git_oid_fromstr(&annotated_id, annotated);
2003 if (err < 0)
2004 return Error_set(err);
2005
2006 err = git_note_create(&note_id, self->repo, ref, py_author->signature,
2007 py_committer->signature,
2008 &annotated_id, message, force);
2009 if (err < 0)
2010 return Error_set(err);
2011
2012 return git_oid_to_python(&note_id);
2013}
2014
2015
2016PyDoc_STRVAR(Repository_lookup_note__doc__,

Callers

nothing calls this directly

Calls 2

Error_setFunction · 0.85
git_oid_to_pythonFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…