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

Function hash

src/pygit2.c:174–191  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

172 "Returns the oid of a new blob from a string without actually writing to\n"
173 "the odb.");
174PyObject *
175hash(PyObject *self, PyObject *args)
176{
177 git_oid oid;
178 const char *data;
179 Py_ssize_t size;
180 int err;
181
182 if (!PyArg_ParseTuple(args, "s#", &data, &size))
183 return NULL;
184
185 err = git_odb_hash(&oid, data, size, GIT_OBJECT_BLOB);
186 if (err < 0) {
187 return Error_set(err);
188 }
189
190 return git_oid_to_python(&oid);
191}
192
193
194PyDoc_STRVAR(init_file_backend__doc__,

Callers 1

test_hashingFunction · 0.85

Calls 2

Error_setFunction · 0.85
git_oid_to_pythonFunction · 0.85

Tested by 1

test_hashingFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…