Mirror of @tangled.org/core. Running on a Raspberry Pi Zero 2

knotserver/git: move tag signatures out of message

Signed-off-by: oppiliappan <me@oppi.li>

authored by oppi.li and committed by tangled.org deed1628 6a8cc01e

+21 -6
+20 -5
knotserver/git/tag.go
··· 34 34 "taggername", 35 35 "taggeremail", 36 36 "taggerdate:unix", 37 - "contents", 37 + "contents:subject", 38 + "contents:body", 39 + "contents:signature", 38 40 } 39 41 40 42 var outFormat strings.Builder ··· 97 95 taggerName := parts[5] 98 96 taggerEmail := parts[6] 99 97 taggerDate := parts[7] 100 - message := parts[8] 98 + subject := parts[8] 99 + body := parts[9] 100 + signature := parts[10] 101 + 102 + // combine subject and body for the message 103 + var message string 104 + if subject != "" && body != "" { 105 + message = subject + "\n\n" + body 106 + } else if subject != "" { 107 + message = subject 108 + } else { 109 + message = body 110 + } 101 111 102 112 // parse creation time 103 113 var createdAt time.Time ··· 134 120 Email: taggerEmail, 135 121 When: createdAt, 136 122 }, 137 - Message: message, 138 - TargetType: typ, 139 - Target: plumbing.NewHash(targetHash), 123 + Message: message, 124 + PGPSignature: signature, 125 + TargetType: typ, 126 + Target: plumbing.NewHash(targetHash), 140 127 } 141 128 142 129 tags = append(tags, tag)
+1 -1
knotserver/git/tag_test.go
··· 323 323 assert.Equal(s.T(), "Tagger One", v1Tag.Tagger.Name, "tagger name should match") 324 324 assert.Equal(s.T(), "tagger1@example.com", v1Tag.Tagger.Email, "tagger email should match") 325 325 326 - assert.Equal(s.T(), "Release version 1.0.0\n\nThis is the first stable release.", 326 + assert.Equal(s.T(), "Release version 1.0.0\n\nThis is the first stable release.\n", 327 327 v1Tag.Message, "tag message should match") 328 328 329 329 assert.Equal(s.T(), plumbing.TagObject, v1Tag.TargetType,