aboutsummaryrefslogtreecommitdiffstats
path: root/repository_test.go
diff options
context:
space:
mode:
authorPaulo Gomes <pjbgf@linux.com>2023-03-02 21:37:26 +0000
committerGitHub <noreply@github.com>2023-03-02 21:37:26 +0000
commit7e345bb5e163a4badefb0c54da3a057dcde50ed6 (patch)
tree7e50a6e47300559e2fafee41d31fe8744608901d /repository_test.go
parent3389b571c09bdc919d2acf31055996534ef96c69 (diff)
parent3486338715d0c1385992c6ca8db6bd04fd0df135 (diff)
downloadgo-git-7e345bb5e163a4badefb0c54da3a057dcde50ed6.tar.gz
Merge pull request #696 from pjbgf/fix-panic-rr
*: Fix panic for empty revisions. Fixes #674
Diffstat (limited to 'repository_test.go')
-rw-r--r--repository_test.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/repository_test.go b/repository_test.go
index 7a9db15..468ce33 100644
--- a/repository_test.go
+++ b/repository_test.go
@@ -2953,6 +2953,15 @@ func (s *RepositorySuite) TestDotGitToOSFilesystemsInvalidPath(c *C) {
c.Assert(err, NotNil)
}
+func (s *RepositorySuite) TestIssue674(c *C) {
+ r, _ := Init(memory.NewStorage(), nil)
+ h, err := r.ResolveRevision(plumbing.Revision(""))
+
+ c.Assert(err, NotNil)
+ c.Assert(h, NotNil)
+ c.Check(h.IsZero(), Equals, true)
+}
+
func BenchmarkObjects(b *testing.B) {
defer fixtures.Clean()