From 7d3b76ea83c16c23477eb940ac97c38eb7d05941 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=2E=20David=20Ib=C3=A1=C3=B1ez?= Date: Sat, 2 Feb 2013 00:12:20 +0100 Subject: [PATCH] Revert mistake --- src/pygit2/repository.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/pygit2/repository.c b/src/pygit2/repository.c index 6ef9bd5..fd31aaa 100644 --- a/src/pygit2/repository.c +++ b/src/pygit2/repository.c @@ -593,14 +593,13 @@ Repository_create_blob(Repository *self, PyObject *data) } PyObject * -Repository_create_blob_fromfile(Repository *self, PyObject *py_path) +Repository_create_blob_fromfile(Repository *self, PyObject *args) { git_oid oid; const char* path; int err; - path = PyString_AsString(py_path); - if (path == NULL) + if (!PyArg_ParseTuple(args, "s", &path)) return NULL; err = git_blob_create_fromworkdir(&oid, self->repo, path); @@ -986,7 +985,7 @@ PyMethodDef Repository_methods[] = { {"create_blob", (PyCFunction)Repository_create_blob, METH_O, Repository_create_blob__doc__}, {"create_blob_fromfile", (PyCFunction)Repository_create_blob_fromfile, - METH_O, + METH_VARARGS, "Create a new blob from file"}, {"create_reference", (PyCFunction)Repository_create_reference, METH_VARARGS|METH_KEYWORDS,