aboutsummaryrefslogtreecommitdiffstats
path: root/repository_test.go
diff options
context:
space:
mode:
authorPaulo Gomes <pjbgf@linux.com>2023-03-02 20:01:04 +0000
committerPaulo Gomes <pjbgf@linux.com>2023-03-02 21:17:11 +0000
commit3486338715d0c1385992c6ca8db6bd04fd0df135 (patch)
tree7e50a6e47300559e2fafee41d31fe8744608901d /repository_test.go
parent3389b571c09bdc919d2acf31055996534ef96c69 (diff)
downloadgo-git-3486338715d0c1385992c6ca8db6bd04fd0df135.tar.gz
*: Fix panic for empty revisions
Signed-off-by: Paulo Gomes <pjbgf@linux.com>
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()