Fix error handling in Repository.write
This commit is contained in:
parent
5652ed7e37
commit
e560a89f90
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user