Skip to content

Commit 49b7120

Browse files
chriscoolgitster
authored andcommitted
merge-recursive: use find_commit_subject() instead of custom code
Signed-off-by: Christian Couder <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 56ff379 commit 49b7120

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

merge-recursive.c

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -136,16 +136,10 @@ static void output_commit_title(struct merge_options *o, struct commit *commit)
136136
if (parse_commit(commit) != 0)
137137
printf("(bad commit)\n");
138138
else {
139-
const char *s;
140-
int len;
141-
for (s = commit->buffer; *s; s++)
142-
if (*s == '\n' && s[1] == '\n') {
143-
s += 2;
144-
break;
145-
}
146-
for (len = 0; s[len] && '\n' != s[len]; len++)
147-
; /* do nothing */
148-
printf("%.*s\n", len, s);
139+
const char *title;
140+
int len = find_commit_subject(commit->buffer, &title);
141+
if (len)
142+
printf("%.*s\n", len, title);
149143
}
150144
}
151145
}

0 commit comments

Comments
 (0)