diff options
author | Joshua Sjoding <joshua.sjoding@scjalliance.com> | 2016-03-03 00:33:00 -0800 |
---|---|---|
committer | Joshua Sjoding <joshua.sjoding@scjalliance.com> | 2016-03-08 13:09:54 -0800 |
commit | 9e6a03b7956464ccd9d2fbacedd8e5cc23572d02 (patch) | |
tree | 0282f20de8279db354233d1d67e3743e08509020 /objects_test.go | |
parent | 9c9cdff966cc181296f400769d3c8596f17e743a (diff) | |
download | go-git-9e6a03b7956464ccd9d2fbacedd8e5cc23572d02.tar.gz |
Added Object interface for Commit, Tree, Blob and Tag
* New Object interface is distinct from core.Object
* New Object interface is used in places where returned object could be of any type
* Object is implemented by Commit, Tree, Blob, File and Tag
* Added Repository.Object function for retrieving objects of any type
* Tag.Object now returns Object instead of core.Object
* Tag target hash is now publicly accessible
* Renamed Tag.Type field to Tag.TargetType, making it distinct from Tag.Type function
* Fixed infinite recursive loop in TagIter.Close
* TreeWalker.Next now returns Object instead of core.Object
* Removed some duplicate test setup code
Diffstat (limited to 'objects_test.go')
-rw-r--r-- | objects_test.go | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/objects_test.go b/objects_test.go index 6826957..c48b768 100644 --- a/objects_test.go +++ b/objects_test.go @@ -29,6 +29,7 @@ func (s *ObjectsSuite) TestNewCommit(c *C) { commit, err := s.r.Commit(hash) c.Assert(err, IsNil) + c.Assert(commit.Hash, Equals, commit.ID()) c.Assert(commit.Hash.String(), Equals, "a5b8b09e2f8fcb0bb99d3ccb0958157b40890d69") c.Assert(commit.Tree().Hash.String(), Equals, "c2d30fa8ef288618f65f6eed6e168e0d514886f4") |