strbuf_addstr(&buf, line);
strbuf_addstr(&buf, "\n\n");
strbuf_addstr(&buf, " ## Commit message ##\n");
+ } else if (starts_with(line, "Notes") &&
+ line[strlen(line) - 1] == ':') {
+ strbuf_addstr(&buf, "\n\n");
+ /* strip the trailing colon */
+ strbuf_addf(&buf, " ## %.*s ##\n",
+ (int)(strlen(line) - 1), line);
} else if (starts_with(line, " ")) {
p = line + len - 2;
while (isspace(*p) && p >= line)
2: $(test_oid t2) = 2: $(test_oid u2) s/4/A/
3: $(test_oid t3) = 3: $(test_oid u3) s/11/B/
4: $(test_oid t4) ! 4: $(test_oid u4) s/12/B/
- @@ Metadata
+ @@ Commit message
Z
- Z ## Commit message ##
- Z s/12/B/
+ Z
+ Z ## Notes ##
- topic note
+ unmodified note
Z
grep "= 3: .* s/11/B" 0000-* &&
grep "! 4: .* s/12/B" 0000-* &&
sed s/Z/\ /g >expect <<-EOF &&
- @@ Metadata
+ @@ Commit message
Z
- Z ## Commit message ##
- Z s/12/B/
+ Z
+ Z ## Notes ##
- topic note
+ unmodified note
Z
Z ## file ##
Z@@ file: A
EOF
- sed "/@@ Metadata/,/@@ file: A/!d" 0000-* >actual &&
+ sed "/@@ Commit message/,/@@ file: A/!d" 0000-* >actual &&
test_cmp expect actual
'