diff options
| author | Carlos Martín Nieto <[email protected]> | 2015-08-04 14:47:10 +0200 |
|---|---|---|
| committer | Carlos Martín Nieto <[email protected]> | 2015-08-04 14:47:10 +0200 |
| commit | b7159b0cd4b25ee3b1a8eb9e0d4991d297487a36 (patch) | |
| tree | 0228b23ba724935ed417f4d3bf151fe4e28e2ae2 /commit.go | |
| parent | 5d989f2caddad21d0296cd9a6a83cabce88858d5 (diff) | |
Move from an Object interface to a type
An Object should be about representing a libgit2 object rather than
showing which methods it should support.
Change any return of Object to *Object and provide methods to convert
between this and the particular type.
Diffstat (limited to 'commit.go')
| -rw-r--r-- | commit.go | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -14,7 +14,7 @@ import ( // Commit type Commit struct { - gitObject + Object cast_ptr *C.git_commit } @@ -37,7 +37,7 @@ func (c Commit) Tree() (*Tree, error) { return nil, MakeGitError(err) } - return allocObject((*C.git_object)(ptr), c.repo).(*Tree), nil + return allocTree(ptr, c.repo), nil } func (c Commit) TreeId() *Oid { @@ -61,7 +61,7 @@ func (c *Commit) Parent(n uint) *Commit { return nil } - return allocObject((*C.git_object)(cobj), c.repo).(*Commit) + return allocCommit(cobj, c.repo) } func (c *Commit) ParentId(n uint) *Oid { |
