mirror of
https://github.com/git/git.git
synced 2026-01-17 22:26:32 +00:00
Merge branch 'jc/clone-bind-failure' into next
* jc/clone-bind-failure: fetch/clone: check return status from ls-remote gitweb.css: Use monospace fonts for commits and tree-diff. Do not use perl in git-commit.sh diff: Support 256 colors diff: Support both attributes and colors Documentation about exclude/ignore files daemon: new option --detach to run git-daemon in background daemon: new option --pid-file=<path> to store the pid upload-pack: ignore write errors to stderr daemon: if one of the standard fds is missing open it to /dev/null daemon: use a custom die routine with syslog Documentation: Fix ssh://[user@]host.xz URL Adjust t4013 tests to corrected format-patch. format-patch: Generate a newline between the subject header and the message body t4013 diff format tests update Display help for Git mode after pressing `h' or `?' in *git-status* Wrap long lines in docstrings in contrib/emacs/git.el
This commit is contained in:
11
commit.c
11
commit.c
@@ -655,6 +655,9 @@ unsigned long pretty_print_commit(enum cmit_fmt fmt, const struct commit *commit
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!subject)
|
||||
body = 1;
|
||||
|
||||
if (is_empty_line(line, &linelen)) {
|
||||
if (!body)
|
||||
continue;
|
||||
@@ -662,8 +665,6 @@ unsigned long pretty_print_commit(enum cmit_fmt fmt, const struct commit *commit
|
||||
continue;
|
||||
if (fmt == CMIT_FMT_SHORT)
|
||||
break;
|
||||
} else {
|
||||
body = 1;
|
||||
}
|
||||
|
||||
if (subject) {
|
||||
@@ -702,6 +703,12 @@ unsigned long pretty_print_commit(enum cmit_fmt fmt, const struct commit *commit
|
||||
/* Make sure there is an EOLN for the non-oneline case */
|
||||
if (fmt != CMIT_FMT_ONELINE)
|
||||
buf[offset++] = '\n';
|
||||
/*
|
||||
* make sure there is another EOLN to separate the headers from whatever
|
||||
* body the caller appends if we haven't already written a body
|
||||
*/
|
||||
if (fmt == CMIT_FMT_EMAIL && !body)
|
||||
buf[offset++] = '\n';
|
||||
buf[offset] = '\0';
|
||||
return offset;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user