Commit: 4079f754d7b677b61c02ffc1d7687824a4572f8c Parent: f487d2e29aa83ff1efefb26f31d4008735af7e7c Author: Vi Grey Date: 2024-05-29 14:45 UTC Summary: Fix other instances of broken timestamp parsing CHANGELOG.txt | 6 ++++++ src/git.go | 15 ++++++++++++--- src/muninn.go | 2 +- 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 5d5164b..cd6d903 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -2,6 +2,12 @@ All notable changes to this project will be documented in this file. +## [0.1.21] - 2024-05-29 + +### Fixed +- Other instances of timestamp parsing + + ## [0.1.20] - 2024-05-29 ### Fixed diff --git a/src/git.go b/src/git.go index a426ab2..4ffdb7d 100644 --- a/src/git.go +++ b/src/git.go @@ -167,7 +167,10 @@ func getRepoBranches(repo string) (branchList []repoBranch) { branchList[x].author = strings.Join(branchLogStrings[:len(branchLogStrings)-1], "\n") branchList[x].lastCommit, err = time.Parse("2006-01-02T15:04:05-07:00", branchLogStrings[len(branchLogStrings)-1]) if err != nil { - return + branchList[x].lastCommit, err = time.Parse("2006-01-02T15:04:05Z", branchLogStrings[len(branchLogStrings)-1]) + if err != nil { + return + } } } } @@ -208,7 +211,10 @@ func getRepoTags(repo string) (tagList []repoTag) { tagList[x].author = strings.Join(tagLogStrings[:len(tagLogStrings)-1], "\n") tagList[x].lastCommit, err = time.Parse("2006-01-02T15:04:05-07:00", tagLogStrings[len(tagLogStrings)-1]) if err != nil { - return + tagList[x].lastCommit, err = time.Parse("2006-01-02T15:04:05Z", tagLogStrings[len(tagLogStrings)-1]) + if err != nil { + return + } } } } @@ -297,7 +303,10 @@ func getRepoCommitsList(repoPath string) (repoCommitList []repoCommit, err error for _, line := range outSplit { commitData := strings.Split(line, "\x00") if len(commitData) > 3 { - commitTime, _ := time.Parse("2006-01-02T15:04:05-07:00", commitData[3]) + commitTime, err := time.Parse("2006-01-02T15:04:05-07:00", commitData[3]) + if err != nil { + commitTime, _ = time.Parse("2006-01-02T15:04:05Z", commitData[3]) + } repoCommitList = append(repoCommitList, repoCommit{commitData[0], commitData[1], commitData[2], commitTime}) } } diff --git a/src/muninn.go b/src/muninn.go index 032202b..a920d96 100644 --- a/src/muninn.go +++ b/src/muninn.go @@ -10,7 +10,7 @@ import ( const ( PROGRAM = "muninn" - VERSION = "0.1.20" + VERSION = "0.1.21" ) func init() {