merge-recursive: use find_commit_subject() instead of custom code
Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
56ff37941e
commit
49b7120ef1
@ -136,16 +136,10 @@ static void output_commit_title(struct merge_options *o, struct commit *commit)
|
|||||||
if (parse_commit(commit) != 0)
|
if (parse_commit(commit) != 0)
|
||||||
printf("(bad commit)\n");
|
printf("(bad commit)\n");
|
||||||
else {
|
else {
|
||||||
const char *s;
|
const char *title;
|
||||||
int len;
|
int len = find_commit_subject(commit->buffer, &title);
|
||||||
for (s = commit->buffer; *s; s++)
|
if (len)
|
||||||
if (*s == '\n' && s[1] == '\n') {
|
printf("%.*s\n", len, title);
|
||||||
s += 2;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
for (len = 0; s[len] && '\n' != s[len]; len++)
|
|
||||||
; /* do nothing */
|
|
||||||
printf("%.*s\n", len, s);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user