From: Sergey Matveev Date: Thu, 4 Jun 2020 07:27:23 +0000 (+0300) Subject: Manually updated comment objects can not be parsed X-Git-Tag: v0.6.5^0 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=b50ac260477362635c5a9d36f70978d7da5c6395;p=sgblog.git Manually updated comment objects can not be parsed --- 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" )