]> git.ipfire.org Git - thirdparty/git.git/blobdiff - trailer.c
Merge branch 'jk/t0303-clean'
[thirdparty/git.git] / trailer.c
index 3a0710a4583a4a11fa5a87cda88ef6a3d0610870..ef9df4af558fbb18849279cff2e67507026af106 100644 (file)
--- a/trailer.c
+++ b/trailer.c
@@ -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;
+                       }
                }
        }