| 145 | "Returns the oid of a new blob from a file path without actually writing\n" |
| 146 | "to the odb."); |
| 147 | PyObject * |
| 148 | hashfile(PyObject *self, PyObject *args) |
| 149 | { |
| 150 | git_oid oid; |
| 151 | PyBytesObject *py_path = NULL; |
| 152 | const char* path = NULL; |
| 153 | int err; |
| 154 | |
| 155 | if (!PyArg_ParseTuple(args, "O&", PyUnicode_FSConverter, &py_path)) |
| 156 | return NULL; |
| 157 | |
| 158 | if (py_path != NULL) |
| 159 | path = PyBytes_AS_STRING(py_path); |
| 160 | |
| 161 | err = git_odb_hashfile(&oid, path, GIT_OBJECT_BLOB); |
| 162 | Py_XDECREF(py_path); |
| 163 | if (err < 0) |
| 164 | return Error_set(err); |
| 165 | |
| 166 | return git_oid_to_python(&oid); |
| 167 | } |
| 168 | |
| 169 | PyDoc_STRVAR(hash__doc__, |
| 170 | "hash(data: bytes) -> Oid\n" |
nothing calls this directly
no test coverage detected
searching dependent graphs…