From 92648fe0135b48370dfa98d4f31a99a14165b3b2 Mon Sep 17 00:00:00 2001 From: Alberto Cortés Date: Tue, 9 Aug 2016 20:45:01 +0200 Subject: Decode tree bug: incomplete reads break the decoding process (#64) * Add test that fails for incomplete reads from an object * Fix imcomplete reads --- tree.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'tree.go') diff --git a/tree.go b/tree.go index f56d49e..7135813 100644 --- a/tree.go +++ b/tree.go @@ -178,8 +178,7 @@ func (t *Tree) Decode(o core.Object) (err error) { } var hash core.Hash - _, err = r.Read(hash[:]) - if err != nil && err != io.EOF { + if _, err = io.ReadFull(r, hash[:]); err != nil { return err } -- cgit