summaryrefslogtreecommitdiff
path: root/odb.go
diff options
context:
space:
mode:
authorCarlos Martín Nieto <[email protected]>2019-01-02 23:03:07 +0100
committerGitHub <[email protected]>2019-01-02 23:03:07 +0100
commit7e9128bd581d2766672bb14ca6f13976a02764ac (patch)
treeb83e8f185ac4925efe640534a3eb98251905a9d6 /odb.go
parent69175cb426cdb267609b6ede866abf4cc5e86504 (diff)
parentab3470030be17e024c96b7f00c757f8343ca70f5 (diff)
Merge pull request #470 from lhchavez/fix-odbreadstream-read
Return io.EOF on OdbReadStream.Read()
Diffstat (limited to 'odb.go')
-rw-r--r--odb.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/odb.go b/odb.go
index f236fc4..fd27363 100644
--- a/odb.go
+++ b/odb.go
@@ -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)