From c2958bf730224cc3672e2105faa1879ec5f21cee Mon Sep 17 00:00:00 2001 From: ThinkChaos Date: Fri, 17 Feb 2023 16:15:22 -0500 Subject: fix: don't use the `firstErrLine` when it is empty Returning `nil` causes `handleAdvRefDecodeError` to fall back to `io.ErrUnexpectedEOF`. --- plumbing/transport/internal/common/common_test.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'plumbing/transport/internal/common/common_test.go') diff --git a/plumbing/transport/internal/common/common_test.go b/plumbing/transport/internal/common/common_test.go index c60ef3b..affa787 100644 --- a/plumbing/transport/internal/common/common_test.go +++ b/plumbing/transport/internal/common/common_test.go @@ -76,3 +76,17 @@ func (s *CommonSuite) TestIsRepoNotFoundErrorForGogsAccessDenied(c *C) { c.Assert(isRepoNotFound, Equals, true) } + +func (s *CommonSuite) TestCheckNotFoundError(c *C) { + firstErrLine := make(chan string, 1) + + session := session{ + firstErrLine: firstErrLine, + } + + firstErrLine <- "" + + err := session.checkNotFoundError() + + c.Assert(err, IsNil) +} -- cgit