Skip to content
This repository was archived by the owner on Sep 11, 2020. It is now read-only.

Commit 0b7d3fe

Browse files
committed
teach ResolveRevision how to look up annotated tags, test
Signed-off-by: Máximo Cuadros <mcuadros@gmail.com>
1 parent 5dd9376 commit 0b7d3fe

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

repository_test.go

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1505,6 +1505,25 @@ func (s *RepositorySuite) TestResolveRevision(c *C) {
15051505
}
15061506
}
15071507

1508+
func (s *RepositorySuite) TestResolveRevisionAnnotated(c *C) {
1509+
f := fixtures.ByURL("https://github.com/git-fixtures/tags.git").One()
1510+
sto, err := filesystem.NewStorage(f.DotGit())
1511+
c.Assert(err, IsNil)
1512+
r, err := Open(sto, f.DotGit())
1513+
c.Assert(err, IsNil)
1514+
1515+
datas := map[string]string{
1516+
"refs/tags/annotated-tag": "f7b877701fbf855b44c0a9e86f3fdce2c298b07f",
1517+
}
1518+
1519+
for rev, hash := range datas {
1520+
h, err := r.ResolveRevision(plumbing.Revision(rev))
1521+
1522+
c.Assert(err, IsNil)
1523+
c.Check(h.String(), Equals, hash, Commentf("while checking %s", rev))
1524+
}
1525+
}
1526+
15081527
func (s *RepositorySuite) TestResolveRevisionWithErrors(c *C) {
15091528
url := s.GetLocalRepositoryURL(
15101529
fixtures.ByURL("https://github.com/git-fixtures/basic.git").One(),

0 commit comments

Comments
 (0)