From 0d803f2547f21040ddad4594003de3bfd1beb1eb Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Fri, 22 Sep 2023 16:17:03 -0700 Subject: [PATCH] Revert "trailer: teach find_patch_start about --no-divider" This reverts commit ee8c5ee08cee9aee6732ab315e94bc88631c7431, which was premature. It will be replaced with an updated patch. --- trailer.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/trailer.c b/trailer.c index f646e484a2..b6de5d9cb2 100644 --- a/trailer.c +++ b/trailer.c @@ -812,14 +812,14 @@ static ssize_t last_line(const char *buf, size_t len) * Return the position of the start of the patch or the length of str if there * is no patch in the message. */ -static size_t find_patch_start(const char *str, int no_divider) +static size_t find_patch_start(const char *str) { const char *s; for (s = str; *s; s = next_line(s)) { const char *v; - if (!no_divider && skip_prefix(s, "---", &v) && isspace(*v)) + if (skip_prefix(s, "---", &v) && isspace(*v)) return s - str; } @@ -1109,7 +1109,11 @@ void trailer_info_get(struct trailer_info *info, const char *str, ensure_configured(); - patch_start = find_patch_start(str, opts->no_divider); + if (opts->no_divider) + patch_start = strlen(str); + else + patch_start = find_patch_start(str); + trailer_end = find_trailer_end(str, patch_start); trailer_start = find_trailer_start(str, trailer_end);