Signed-off-by: oppiliappan me@oppi.li
+20
-5
knotserver/git/tag.go
+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
···
95
97
taggerName := parts[5]
96
98
taggerEmail := parts[6]
97
99
taggerDate := parts[7]
98
-
message := parts[8]
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
+
}
99
113
100
114
// parse creation time
101
115
var createdAt time.Time
···
120
134
Email: taggerEmail,
121
135
When: createdAt,
122
136
},
123
-
Message: message,
124
-
TargetType: typ,
125
-
Target: plumbing.NewHash(targetHash),
137
+
Message: message,
138
+
PGPSignature: signature,
139
+
TargetType: typ,
140
+
Target: plumbing.NewHash(targetHash),
126
141
}
127
142
128
143
tags = append(tags, tag)
+1
-1
knotserver/git/tag_test.go
+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,
History
2 rounds
0 comments
1 commit
expand
collapse
knotserver/git: move tag signatures out of message
Signed-off-by: oppiliappan <me@oppi.li>
3/3 success
expand
collapse
expand 0 comments
pull request successfully merged
1 commit
expand
collapse
knotserver/git: move tag signatures out of message
Signed-off-by: oppiliappan <me@oppi.li>