summaryrefslogtreecommitdiff
path: root/odb.go
diff options
context:
space:
mode:
authorlhchavez <[email protected]>2018-12-28 04:29:20 +0000
committerlhchavez <[email protected]>2018-12-28 04:35:20 +0000
commit344dc33faef98cb383ec0858e33b1aea695cbc1e (patch)
treebd6c9f87244dbdfde69fe87b98f19d05b8474ab0 /odb.go
parent8b368063e958f421ca973b49fb71a092b696cf92 (diff)
Return io.EOF on OdbReadStream.Read()
This change makes OdbReadStream.Read() comply with the usual io.Reader semantics.
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)