From a964e32d92c53a47ce7c46d589a18c62133b8c50 Mon Sep 17 00:00:00 2001 From: Máximo Cuadros Date: Wed, 17 Feb 2016 00:24:31 +0100 Subject: storages: memory object --- commit.go | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'commit.go') diff --git a/commit.go b/commit.go index 47e48fe..cdfc902 100644 --- a/commit.go +++ b/commit.go @@ -51,6 +51,10 @@ func (c *Commit) File(path string) (file *File, err error) { // Decode transform an core.Object into a Blob struct func (c *Commit) Decode(o core.Object) error { + if o.Type() != core.CommitObject { + return ErrUnsupportedObject + } + c.Hash = o.Hash() r := bufio.NewReader(o.Reader()) -- cgit