From 63c4ccebddd40702fe414a9199cb79bfa5981ea8 Mon Sep 17 00:00:00 2001 From: Yahav Itzhak Date: Wed, 4 Oct 2023 16:22:52 +0300 Subject: [PATCH] Fix error handling in git utils (#841) --- utils/git.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/utils/git.go b/utils/git.go index ea290b1b4..4eac352a1 100644 --- a/utils/git.go +++ b/utils/git.go @@ -141,8 +141,8 @@ func (m *GitManager) readUrl() { IsNextLineUrl = true } } - if err != nil { - m.err = err + if err := scanner.Err(); err != nil { + m.err = errorutils.CheckError(err) return } if !strings.HasSuffix(originUrl, ".git") { @@ -233,8 +233,8 @@ func (m *GitManager) readRevisionFromRef(refPath string) { revision = strings.TrimSpace(text) break } - if err != nil { - m.err = err + if err := scanner.Err(); err != nil { + m.err = errorutils.CheckError(err) return } m.revision = revision @@ -271,8 +271,8 @@ func (m *GitManager) readRevisionFromPackedRef(ref string) { return } } - if err != nil { - m.err = err + if err = scanner.Err(); err != nil { + m.err = errorutils.CheckError(err) return } }