Fix error handling in Repository.write

This commit is contained in:
J. David Ibáñez 2013-11-24 10:46:49 +01:00
parent 5652ed7e37
commit e560a89f90

View File

@ -432,9 +432,16 @@ Repository_write(Repository *self, PyObject *args)
return Error_set(err);
err = git_odb_stream_write(stream, buffer, buflen);
if (!err)
err = git_odb_stream_finalize_write(&oid, stream);
if (err) {
git_odb_stream_free(stream);
return Error_set(err);
}
err = git_odb_stream_finalize_write(&oid, stream);
git_odb_stream_free(stream);
if (err)
return Error_set(err);
return git_oid_to_python(&oid);
}