From 05e5148d0953ea20edca68f740f92bebb53a15b8 Mon Sep 17 00:00:00 2001 From: quobix Date: Thu, 25 Apr 2024 12:24:10 -0400 Subject: [PATCH] resolved issue #128 --- cmd/report.go | 4 +++- cmd/summary.go | 7 ++++++- git/read_local.go | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/cmd/report.go b/cmd/report.go index d48e071..9467041 100644 --- a/cmd/report.go +++ b/cmd/report.go @@ -197,7 +197,9 @@ func GetReportCommand() *cobra.Command { <-doneChan if len(errs) > 0 { for e := range errs { - pterm.Error.Println(errs[e].Error()) + if errs[e] != nil { + pterm.Error.Println(errs[e].Error()) + } } return errors.New("unable to process specifications") } diff --git a/cmd/summary.go b/cmd/summary.go index a3def42..8921c75 100644 --- a/cmd/summary.go +++ b/cmd/summary.go @@ -327,7 +327,12 @@ func runLeftRightSummary(left, right string, updateChan chan *model.ProgressUpda }, } - commits, _ = git.BuildCommitChangelog(commits, updateChan, errorChan, base, remote) + var errs []error + commits, errs = git.BuildCommitChangelog(commits, updateChan, errorChan, base, remote) + if len(errs) > 0 { + close(updateChan) + return errs + } if len(commits) <= 0 { close(updateChan) diff --git a/git/read_local.go b/git/read_local.go index 85cc961..ff4374d 100644 --- a/git/read_local.go +++ b/git/read_local.go @@ -225,7 +225,7 @@ func BuildCommitChangelog(commitHistory []*model.Commit, if errs != nil { model.SendProgressError("building models", fmt.Sprintf("Error thrown when comparing: %s", errs[0].Error()), errorChan) - changeErrors = append(changeErrors, err) + changeErrors = append(changeErrors, errs...) } commitHistory[c].Changes = changes } else {