Merge branch 'jk/format-patch-am'
* jk/format-patch-am: format-patch: preserve subject newlines with -k clean up calling conventions for pretty.c functions pretty: add pp_commit_easy function for simple callers mailinfo: always clean up rfc822 header folding t: test subject handling in format-patch / am pipeline Conflicts: builtin/branch.c builtin/log.c commit.h
This commit is contained in:
@ -138,9 +138,8 @@ void shortlog_add_commit(struct shortlog *log, struct commit *commit)
|
||||
const char *author = NULL, *buffer;
|
||||
struct strbuf buf = STRBUF_INIT;
|
||||
struct strbuf ufbuf = STRBUF_INIT;
|
||||
struct pretty_print_context ctx = {0};
|
||||
|
||||
pretty_print_commit(CMIT_FMT_RAW, commit, &buf, &ctx);
|
||||
pp_commit_easy(CMIT_FMT_RAW, commit, &buf);
|
||||
buffer = buf.buf;
|
||||
while (*buffer && *buffer != '\n') {
|
||||
const char *eol = strchr(buffer, '\n');
|
||||
@ -159,11 +158,12 @@ void shortlog_add_commit(struct shortlog *log, struct commit *commit)
|
||||
sha1_to_hex(commit->object.sha1));
|
||||
if (log->user_format) {
|
||||
struct pretty_print_context ctx = {0};
|
||||
ctx.fmt = CMIT_FMT_USERFORMAT;
|
||||
ctx.abbrev = log->abbrev;
|
||||
ctx.subject = "";
|
||||
ctx.after_subject = "";
|
||||
ctx.date_mode = DATE_NORMAL;
|
||||
pretty_print_commit(CMIT_FMT_USERFORMAT, commit, &ufbuf, &ctx);
|
||||
pretty_print_commit(&ctx, commit, &ufbuf);
|
||||
buffer = ufbuf.buf;
|
||||
} else if (*buffer) {
|
||||
buffer++;
|
||||
|
Reference in New Issue
Block a user