aboutsummaryrefslogtreecommitdiffstats
path: root/repository_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'repository_test.go')
-rw-r--r--repository_test.go20
1 files changed, 19 insertions, 1 deletions
diff --git a/repository_test.go b/repository_test.go
index 6d34d42..6c8014c 100644
--- a/repository_test.go
+++ b/repository_test.go
@@ -2065,7 +2065,25 @@ func (s *RepositorySuite) TestResolveRevision(c *C) {
h, err := r.ResolveRevision(plumbing.Revision(rev))
c.Assert(err, IsNil)
- c.Assert(h.String(), Equals, hash)
+ c.Check(h.String(), Equals, hash, Commentf("while checking %s", rev))
+ }
+}
+
+func (s *RepositorySuite) TestResolveRevisionAnnotated(c *C) {
+ f := fixtures.ByURL("https://github.com/git-fixtures/tags.git").One()
+ sto := filesystem.NewStorage(f.DotGit(), cache.NewObjectLRUDefault())
+ r, err := Open(sto, f.DotGit())
+ c.Assert(err, IsNil)
+
+ datas := map[string]string{
+ "refs/tags/annotated-tag": "f7b877701fbf855b44c0a9e86f3fdce2c298b07f",
+ }
+
+ for rev, hash := range datas {
+ h, err := r.ResolveRevision(plumbing.Revision(rev))
+
+ c.Assert(err, IsNil)
+ c.Check(h.String(), Equals, hash, Commentf("while checking %s", rev))
}
}