diff options
author | Christian Couder <chriscool@tuxfamily.org> | 2010-07-22 15:18:33 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2010-07-23 16:12:47 -0700 |
commit | 56ff37941eb76d3f0097884715ca8b391788a3c9 (patch) | |
tree | 3261d434a78bcd0bfa36a69dcd390fc627161ad2 | |
parent | dfe7effe7d873015c8624d438b98671083c12e27 (diff) | |
download | git-56ff37941eb76d3f0097884715ca8b391788a3c9.tar.gz git-56ff37941eb76d3f0097884715ca8b391788a3c9.tar.xz |
bisect: 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>
-rw-r--r-- | bisect.c | 13 |
1 files changed, 5 insertions, 8 deletions
@@ -141,7 +141,8 @@ static void show_list(const char *debug, int counted, int nr, enum object_type type; unsigned long size; char *buf = read_sha1_file(commit->object.sha1, &type, &size); - char *ep, *sp; + const char *subject_start; + int subject_len; fprintf(stderr, "%c%c%c ", (flags & TREESAME) ? ' ' : 'T', @@ -156,13 +157,9 @@ static void show_list(const char *debug, int counted, int nr, fprintf(stderr, " %.*s", 8, sha1_to_hex(pp->item->object.sha1)); - sp = strstr(buf, "\n\n"); - if (sp) { - sp += 2; - for (ep = sp; *ep && *ep != '\n'; ep++) - ; - fprintf(stderr, " %.*s", (int)(ep - sp), sp); - } + subject_len = find_commit_subject(buf, &subject_start); + if (subject_len) + fprintf(stderr, " %.*s", subject_len, subject_start); fprintf(stderr, "\n"); } } |