Return io.EOF on OdbReadStream.Read() #470

Merged
lhchavez merged 2 commits from fix-odbreadstream-read into master 2019-01-02 16:03:08 -06:00
1 changed files with 4 additions and 0 deletions
Showing only changes of commit 344dc33fae - Show all commits

4
odb.go
View File

@ -8,6 +8,7 @@ extern void _go_git_odb_backend_free(git_odb_backend *backend);
*/
import "C"
import (
"io"
"reflect"
"runtime"
"unsafe"
@ -287,6 +288,9 @@ func (stream *OdbReadStream) Read(data []byte) (int, error) {
if ret < 0 {
return 0, MakeGitError(ret)
}
if ret == 0 {
return 0, io.EOF
}
header.Len = int(ret)