Skip to content

Commit 7e29431

Browse files
hanyang-tonygitster
authored andcommitted
blame: remove parameter detailed in get_commit_info()
The get_commit_info() function accepts a parameter that can be used to stop the commit parsing early. However, none of the callers use this feature, and testing proved that the performance gain of stopping parsing early is negligible and unmeasurable. Signed-off-by: Han Young <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent e4ef048 commit 7e29431

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

builtin/blame.c

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -197,9 +197,7 @@ static void commit_info_destroy(struct commit_info *ci)
197197
strbuf_release(&ci->summary);
198198
}
199199

200-
static void get_commit_info(struct commit *commit,
201-
struct commit_info *ret,
202-
int detailed)
200+
static void get_commit_info(struct commit *commit, struct commit_info *ret)
203201
{
204202
int len;
205203
const char *subject, *encoding;
@@ -211,11 +209,6 @@ static void get_commit_info(struct commit *commit,
211209
&ret->author, &ret->author_mail,
212210
&ret->author_time, &ret->author_tz);
213211

214-
if (!detailed) {
215-
repo_unuse_commit_buffer(the_repository, commit, message);
216-
return;
217-
}
218-
219212
get_ac_line(message, "\ncommitter ",
220213
&ret->committer, &ret->committer_mail,
221214
&ret->committer_time, &ret->committer_tz);
@@ -263,7 +256,7 @@ static int emit_one_suspect_detail(struct blame_origin *suspect, int repeat)
263256
return 0;
264257

265258
suspect->commit->object.flags |= METAINFO_SHOWN;
266-
get_commit_info(suspect->commit, &ci, 1);
259+
get_commit_info(suspect->commit, &ci);
267260
printf("author %s\n", ci.author.buf);
268261
printf("author-mail %s\n", ci.author_mail.buf);
269262
printf("author-time %"PRItime"\n", ci.author_time);
@@ -471,7 +464,7 @@ static void emit_other(struct blame_scoreboard *sb, struct blame_entry *ent, int
471464
int show_raw_time = !!(opt & OUTPUT_RAW_TIMESTAMP);
472465
const char *default_color = NULL, *color = NULL, *reset = NULL;
473466

474-
get_commit_info(suspect->commit, &ci, 1);
467+
get_commit_info(suspect->commit, &ci);
475468
oid_to_hex_r(hex, &suspect->commit->object.oid);
476469

477470
cp = blame_nth_line(sb, ent->lno);
@@ -665,7 +658,7 @@ static void find_alignment(struct blame_scoreboard *sb, int *option)
665658
if (!(suspect->commit->object.flags & METAINFO_SHOWN)) {
666659
struct commit_info ci = COMMIT_INFO_INIT;
667660
suspect->commit->object.flags |= METAINFO_SHOWN;
668-
get_commit_info(suspect->commit, &ci, 1);
661+
get_commit_info(suspect->commit, &ci);
669662
if (*option & OUTPUT_SHOW_EMAIL)
670663
num = utf8_strwidth(ci.author_mail.buf);
671664
else

0 commit comments

Comments
 (0)