summaryrefslogtreecommitdiff
path: root/bisect.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2010-08-18 12:46:55 -0700
committerJunio C Hamano <gitster@pobox.com>2010-08-18 12:46:55 -0700
commit165dc789d5e201a06e0de5a984e4529ae62027fc (patch)
treeae0b12015f7fabfe34ca73829aa81d2b4522461f /bisect.c
parent29e1353a7debe4e73cb5d6d2d5a0c4479e9eb768 (diff)
parentad98a58b3d7a151dca59364b72097b6b875a56f6 (diff)
downloadgit-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 'bisect.c')
-rw-r--r--bisect.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/bisect.c b/bisect.c
index b556b11610..060c042f8b 100644
--- a/bisect.c
+++ b/bisect.c
@@ -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");
}
}