diff options
author | Junio C Hamano <gitster@pobox.com> | 2010-08-18 12:46:55 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2010-08-18 12:46:55 -0700 |
commit | 165dc789d5e201a06e0de5a984e4529ae62027fc (patch) | |
tree | ae0b12015f7fabfe34ca73829aa81d2b4522461f /merge-recursive.c | |
parent | 29e1353a7debe4e73cb5d6d2d5a0c4479e9eb768 (diff) | |
parent | ad98a58b3d7a151dca59364b72097b6b875a56f6 (diff) | |
download | git-165dc789d5e201a06e0de5a984e4529ae62027fc.tar.gz |
Merge branch 'cc/find-commit-subject'
* cc/find-commit-subject:
blame: use find_commit_subject() instead of custom code
merge-recursive: use find_commit_subject() instead of custom code
bisect: use find_commit_subject() instead of custom code
revert: rename variables related to subject in get_message()
revert: refactor code to find commit subject in find_commit_subject()
revert: fix off by one read when searching the end of a commit subject
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 fb6aa4a551..7635659969 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); } } } |