Browse Source

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>
maint
Christian Couder 15 years ago committed by Junio C Hamano
parent
commit
56ff37941e
  1. 13
      bisect.c

13
bisect.c

@ -141,7 +141,8 @@ static void show_list(const char *debug, int counted, int nr,
enum object_type type; enum object_type type;
unsigned long size; unsigned long size;
char *buf = read_sha1_file(commit->object.sha1, &type, &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 ", fprintf(stderr, "%c%c%c ",
(flags & TREESAME) ? ' ' : 'T', (flags & TREESAME) ? ' ' : 'T',
@ -156,13 +157,9 @@ static void show_list(const char *debug, int counted, int nr,
fprintf(stderr, " %.*s", 8, fprintf(stderr, " %.*s", 8,
sha1_to_hex(pp->item->object.sha1)); sha1_to_hex(pp->item->object.sha1));


sp = strstr(buf, "\n\n"); subject_len = find_commit_subject(buf, &subject_start);
if (sp) { if (subject_len)
sp += 2; fprintf(stderr, " %.*s", subject_len, subject_start);
for (ep = sp; *ep && *ep != '\n'; ep++)
;
fprintf(stderr, " %.*s", (int)(ep - sp), sp);
}
fprintf(stderr, "\n"); fprintf(stderr, "\n");
} }
} }

Loading…
Cancel
Save