Skip to content

Commit

Permalink
bisect: use find_commit_subject() instead of custom code
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Christian Couder authored and Junio C Hamano committed Jul 23, 2010
1 parent dfe7eff commit 56ff379
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions bisect.c
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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");
}
}
Expand Down

0 comments on commit 56ff379

Please sign in to comment.