| 172 | "Returns the oid of a new blob from a string without actually writing to\n" |
| 173 | "the odb."); |
| 174 | PyObject * |
| 175 | hash(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 | |
| 194 | PyDoc_STRVAR(init_file_backend__doc__, |
searching dependent graphs…