aboutsummaryrefslogtreecommitdiffstats
path: root/commit.go
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2016-02-17 00:24:31 +0100
committerMáximo Cuadros <mcuadros@gmail.com>2016-02-17 11:46:00 +0100
commita964e32d92c53a47ce7c46d589a18c62133b8c50 (patch)
tree4c094cd6afb95cb2832f866b9411276418435819 /commit.go
parent1ac00554c3b5f88d2ddc2e28e7cfcdcad9d9f4bb (diff)
downloadgo-git-a964e32d92c53a47ce7c46d589a18c62133b8c50.tar.gz
storages: memory object
Diffstat (limited to 'commit.go')
-rw-r--r--commit.go4
1 files changed, 4 insertions, 0 deletions
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())