Skip to content

Commit 7954d36

Browse files
peffgitster
authored andcommitted
log: drop unused rev_info from early output
The early output code passes around a rev_info struct but doesn't need it. The setup step only turns on global signal handlers, and the "estimate" step is done completely from the rev->commits list that is passed in separately. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 9163399 commit 7954d36

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

builtin/log.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ static void cmd_log_init(int argc, const char **argv, const char *prefix,
251251
* This gives a rough estimate for how many commits we
252252
* will print out in the list.
253253
*/
254-
static int estimate_commit_count(struct rev_info *rev, struct commit_list *list)
254+
static int estimate_commit_count(struct commit_list *list)
255255
{
256256
int n = 0;
257257

@@ -289,7 +289,7 @@ static void log_show_early(struct rev_info *revs, struct commit_list *list)
289289
switch (simplify_commit(revs, commit)) {
290290
case commit_show:
291291
if (show_header) {
292-
int n = estimate_commit_count(revs, list);
292+
int n = estimate_commit_count(list);
293293
show_early_header(revs, "incomplete", n);
294294
show_header = 0;
295295
}
@@ -333,7 +333,7 @@ static void early_output(int signal)
333333
show_early_output = log_show_early;
334334
}
335335

336-
static void setup_early_output(struct rev_info *rev)
336+
static void setup_early_output(void)
337337
{
338338
struct sigaction sa;
339339

@@ -364,7 +364,7 @@ static void setup_early_output(struct rev_info *rev)
364364

365365
static void finish_early_output(struct rev_info *rev)
366366
{
367-
int n = estimate_commit_count(rev, rev->commits);
367+
int n = estimate_commit_count(rev->commits);
368368
signal(SIGALRM, SIG_IGN);
369369
show_early_header(rev, "done", n);
370370
}
@@ -376,7 +376,7 @@ static int cmd_log_walk(struct rev_info *rev)
376376
int saved_dcctc = 0, close_file = rev->diffopt.close_file;
377377

378378
if (rev->early_output)
379-
setup_early_output(rev);
379+
setup_early_output();
380380

381381
if (prepare_revision_walk(rev))
382382
die(_("revision walk setup failed"));

0 commit comments

Comments
 (0)