The rule is this: if the last line already contains the sign off by the
current committer, do nothing. If it contains another sign off, just
add the sign off of the current committer. If the last line does not
contain a sign off, add a new line before adding the sign off.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
for (i = sb.len - 1; i > 0 && sb.buf[i - 1] != '\n'; i--)
; /* do nothing */
- if (prefixcmp(sb.buf + i, sob.buf))
+ if (prefixcmp(sb.buf + i, sob.buf)) {
+ if (prefixcmp(sb.buf + i, sign_off_header))
+ strbuf_addch(&sb, '\n');
strbuf_addbuf(&sb, &sob);
+ }
strbuf_release(&sob);
}
cat > expect << EOF
zort
+
Signed-off-by: C O Mitter <committer@example.com>
EOF