Fix issue reported by Travis for Python3.1 and Python3.2
This commit is contained in:
@@ -224,17 +224,20 @@ Index_contains(Index *self, PyObject *value)
|
|||||||
char *path;
|
char *path;
|
||||||
int idx;
|
int idx;
|
||||||
|
|
||||||
path = PyString_AsString(value);
|
path = py_path_to_c_str(value);
|
||||||
if (!path)
|
if (!path)
|
||||||
return -1;
|
return -1;
|
||||||
idx = git_index_find(self->index, path);
|
idx = git_index_find(self->index, path);
|
||||||
if (idx == GIT_ENOTFOUND)
|
if (idx == GIT_ENOTFOUND) {
|
||||||
|
free(path);
|
||||||
return 0;
|
return 0;
|
||||||
|
}
|
||||||
if (idx < 0) {
|
if (idx < 0) {
|
||||||
|
free(path);
|
||||||
Error_set_str(idx, path);
|
Error_set_str(idx, path);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
free(path);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user