From b50ac260477362635c5a9d36f70978d7da5c6395 Mon Sep 17 00:00:00 2001 From: Sergey Matveev Date: Thu, 4 Jun 2020 10:27:23 +0300 Subject: [PATCH] Manually updated comment objects can not be parsed --- cmd/sgblog/http.go | 5 ++++- common.go | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/cmd/sgblog/http.go b/cmd/sgblog/http.go index 85359b3..a4ad671 100644 --- a/cmd/sgblog/http.go +++ b/cmd/sgblog/http.go @@ -473,11 +473,14 @@ func serveHTTP() { commentedHash := plumbing.NewHash(strings.ReplaceAll( fileStats[0].Name, "/", "", )) - comments := parseComments(getNote(t, commentedHash)) commit, err = repo.CommitObject(commentedHash) if err != nil { makeErr(err) } + comments := parseComments(getNote(t, commentedHash)) + if len(comments) == 0 { + continue + } commentN := strconv.Itoa(len(comments) - 1) lines := strings.Split(comments[len(comments)-1], "\n") from := strings.TrimPrefix(lines[0], "From: ") diff --git a/common.go b/common.go index db523a6..64133be 100644 --- a/common.go +++ b/common.go @@ -2,6 +2,6 @@ package sgblog const ( - Version = "0.6.4" + Version = "0.6.5" WhenFmt = "2006-01-02 15:04:05Z07:00" ) -- 2.48.1