+13
gitdiff/patch_header.go
+13
gitdiff/patch_header.go
···
52
52
// line, that line will be removed and everything after it will be
53
53
// placed in BodyAppendix.
54
54
BodyAppendix string
55
+
56
+
// All headers completely unparsed
57
+
RawHeaders map[string][]string
55
58
}
56
59
57
60
// Message returns the commit message for the header. The message consists of
···
237
240
break
238
241
}
239
242
243
+
items := strings.SplitN(line, ":", 2)
244
+
245
+
// we have "key: value"
246
+
if len(items) == 2 {
247
+
key := items[0]
248
+
val := items[1]
249
+
h.RawHeaders[key] = append(h.RawHeaders[key], val)
250
+
}
251
+
240
252
switch {
241
253
case strings.HasPrefix(line, authorPrefix):
242
254
u, err := ParsePatchIdentity(line[len(authorPrefix):])
···
361
373
}
362
374
363
375
h := &PatchHeader{}
376
+
h.RawHeaders = msg.Header
364
377
365
378
if strings.HasPrefix(mailLine, mailHeaderPrefix) {
366
379
mailLine = strings.TrimPrefix(mailLine, mailHeaderPrefix)