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

Function py_oid_to_git_oid_expand

src/oid.c:101–134  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

99}
100
101int
102py_oid_to_git_oid_expand(git_repository *repo, PyObject *py_str, git_oid *oid)
103{
104 int err;
105 size_t len;
106 git_odb *odb = NULL;
107 git_oid tmp;
108
109 len = py_oid_to_git_oid(py_str, oid);
110 if (len == 0)
111 return -1;
112
113 if (len == GIT_OID_HEXSZ)
114 return 0;
115
116 /* Short oid */
117 err = git_repository_odb(&odb, repo);
118 if (err < 0)
119 goto error;
120
121 err = git_odb_exists_prefix(&tmp, odb, oid, len);
122 if (err < 0)
123 goto error;
124
125 git_oid_cpy(oid, &tmp);
126
127 git_odb_free(odb);
128 return 0;
129
130error:
131 git_odb_free(odb);
132 Error_set(err);
133 return -1;
134}
135
136PyObject *
137git_oid_to_py_str(const git_oid *oid)

Callers 11

Reference_set_targetFunction · 0.85
Repository_descendant_ofFunction · 0.85
Repository_merge_baseFunction · 0.85
merge_base_xxxFunction · 0.85
Repository_walkFunction · 0.85
Repository_TreeBuilderFunction · 0.85
Repository_expand_idFunction · 0.85
Walker_hideFunction · 0.85
Walker_pushFunction · 0.85

Calls 2

py_oid_to_git_oidFunction · 0.85
Error_setFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…