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

Function Repository_create_blob_fromdisk

src/repository.c:919–935  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

917 "Create a new blob from a file anywhere (no working directory check).");
918
919PyObject *
920Repository_create_blob_fromdisk(Repository *self, PyObject *value)
921{
922 PyObject *tvalue;
923 char *path = pgit_borrow_fsdefault(value, &tvalue);
924 if (path == NULL)
925 return NULL;
926
927 git_oid oid;
928 int err = git_blob_create_fromdisk(&oid, self->repo, path);
929 Py_DECREF(tvalue);
930
931 if (err < 0)
932 return Error_set(err);
933
934 return git_oid_to_python(&oid);
935}
936
937
938#define BUFSIZE 4096

Callers

nothing calls this directly

Calls 3

pgit_borrow_fsdefaultFunction · 0.85
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…