From 579399e38a80422e47cd21023ee60259be975bf3 Mon Sep 17 00:00:00 2001 From: niukuo Date: Wed, 27 Mar 2019 23:32:01 +0800 Subject: fix panic in object.Tree.FindEntry Signed-off-by: niukuo --- plumbing/object/tree_test.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'plumbing/object/tree_test.go') diff --git a/plumbing/object/tree_test.go b/plumbing/object/tree_test.go index 889c63a..b408595 100644 --- a/plumbing/object/tree_test.go +++ b/plumbing/object/tree_test.go @@ -125,6 +125,9 @@ func (s *TreeSuite) TestFindEntryNotFound(c *C) { e, err := s.Tree.FindEntry("not-found") c.Assert(e, IsNil) c.Assert(err, Equals, ErrEntryNotFound) + e, err = s.Tree.FindEntry("not-found/not-found/not-found") + c.Assert(e, IsNil) + c.Assert(err, Equals, ErrDirectoryNotFound) } // Overrides returned plumbing.EncodedObject for given hash. -- cgit