diff options
author | Christian Couder <chriscool@tuxfamily.org> | 2010-07-22 15:18:34 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2010-07-23 16:12:47 -0700 |
commit | 49b7120ef1c915439b01f23f30ddfe64565ec9cc (patch) | |
tree | 8e587e41b6eef867122c48895002686e71ac69ea /merge-recursive.c | |
parent | 56ff37941eb76d3f0097884715ca8b391788a3c9 (diff) | |
download | git-49b7120ef1c915439b01f23f30ddfe64565ec9cc.tar.gz |
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>
Diffstat (limited to 'merge-recursive.c')
-rw-r--r-- | merge-recursive.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/merge-recursive.c b/merge-recursive.c index 206c103635..34837bd5d4 100644 --- a/merge-recursive.c +++ b/merge-recursive.c @@ -136,16 +136,10 @@ static void output_commit_title(struct merge_options *o, struct commit *commit) if (parse_commit(commit) != 0) printf("(bad commit)\n"); else { - const char *s; - int len; - for (s = commit->buffer; *s; s++) - if (*s == '\n' && s[1] == '\n') { - s += 2; - break; - } - for (len = 0; s[len] && '\n' != s[len]; len++) - ; /* do nothing */ - printf("%.*s\n", len, s); + const char *title; + int len = find_commit_subject(commit->buffer, &title); + if (len) + printf("%.*s\n", len, title); } } } |