Fix issue reported by Travis for Python3.1 and Python3.2

This commit is contained in:
delanne 2012-11-09 16:19:47 +01:00
parent 9ffbe7b2ce
commit 8216dad986

@ -224,17 +224,20 @@ Index_contains(Index *self, PyObject *value)
char *path;
int idx;
path = PyString_AsString(value);
path = py_path_to_c_str(value);
if (!path)
return -1;
idx = git_index_find(self->index, path);
if (idx == GIT_ENOTFOUND)
if (idx == GIT_ENOTFOUND) {
free(path);
return 0;
}
if (idx < 0) {
free(path);
Error_set_str(idx, path);
return -1;
}
free(path);
return 1;
}