Signed-off-by: oppiliappan me@oppi.li
+20
-5
knotserver/git/tag.go
+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
+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
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>