]> Sergey Matveev's repositories - sgblog.git/commitdiff
Manually updated comment objects can not be parsed v0.6.5
authorSergey Matveev <stargrave@stargrave.org>
Thu, 4 Jun 2020 07:27:23 +0000 (10:27 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Thu, 4 Jun 2020 07:27:44 +0000 (10:27 +0300)
cmd/sgblog/http.go
common.go

index 85359b3162cab61b643e9741945d475dfff8aeb2..a4ad6713a42d3861a3c4da6d0ec6dcc500448b44 100644 (file)
@@ -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: ")
index db523a65053f0ae310252ebb00388965ca106ea2..64133becea1dfe5f1b89e7fa1a3827513a1750d0 100644 (file)
--- 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"
 )