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

Function wrap_diff_file

src/diff.c:69–93  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

67}
68
69PyObject *
70wrap_diff_file(const git_diff_file *file)
71{
72 DiffFile *py_file;
73
74 if (!file)
75 Py_RETURN_NONE;
76
77 py_file = PyObject_New(DiffFile, &DiffFileType);
78 if (py_file) {
79 py_file->id = git_oid_to_python(&file->id);
80 if (file->path) {
81 py_file->path = strdup(file->path);
82 py_file->raw_path = PyBytes_FromString(file->path);
83 } else {
84 py_file->path = NULL;
85 py_file->raw_path = NULL;
86 }
87 py_file->size = file->size;
88 py_file->flags = file->flags;
89 py_file->mode = file->mode;
90 }
91
92 return (PyObject *) py_file;
93}
94
95PyObject *
96wrap_diff_delta(const git_diff_delta *delta)

Callers 2

wrap_diff_deltaFunction · 0.85
DiffFile_from_cFunction · 0.85

Calls 1

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…