aboutsummaryrefslogtreecommitdiffstats
path: root/commit.go
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2016-02-17 11:52:11 +0100
committerMáximo Cuadros <mcuadros@gmail.com>2016-02-17 11:52:11 +0100
commit104be6870196d221a06291917c8660412a96cdbc (patch)
tree4c094cd6afb95cb2832f866b9411276418435819 /commit.go
parent1ac00554c3b5f88d2ddc2e28e7cfcdcad9d9f4bb (diff)
parenta964e32d92c53a47ce7c46d589a18c62133b8c50 (diff)
downloadgo-git-104be6870196d221a06291917c8660412a96cdbc.tar.gz
Merge pull request #28 from mcuadros/memory-object
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())