Monorepo for Tangled tangled.org

knotserver/git: move tag signatures out of message #1078

merged opened by oppi.li targeting master from op/rymnmmultwps
Labels

None yet.

assignee

None yet.

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

History

2 rounds 0 comments
sign up or login to add to the discussion
1 commit
expand
knotserver/git: move tag signatures out of message
3/3 success
expand
expand 0 comments
pull request successfully merged
oppi.li submitted #0
1 commit
expand
knotserver/git: move tag signatures out of message
1/3 failed, 2/3 success
expand
expand 0 comments