Merge branch 'la/trailer-cleanups'

Fix to an already-graduated topic.

* la/trailer-cleanups:
  trailer: fix comment/cut-line regression with opts->no_divider
This commit is contained in:
Junio C Hamano
2024-02-19 20:58:06 -08:00
3 changed files with 44 additions and 8 deletions

View File

@@ -845,16 +845,15 @@ static size_t find_end_of_log_message(const char *input, int no_divider)
/* Assume the naive end of the input is already what we want. */
end = strlen(input);
if (no_divider)
return end;
/* Optionally skip over any patch part ("---" line and below). */
for (s = input; *s; s = next_line(s)) {
const char *v;
if (!no_divider) {
for (s = input; *s; s = next_line(s)) {
const char *v;
if (skip_prefix(s, "---", &v) && isspace(*v)) {
end = s - input;
break;
if (skip_prefix(s, "---", &v) && isspace(*v)) {
end = s - input;
break;
}
}
}