Skip to content

Commit d68ce90

Browse files
rscharfegitster
authored andcommitted
commit-graph: use progress title directly
merge_commit_graphs() copies the (translated) progress message into a strbuf and passes the copy to start_delayed_progress() at each loop iteration. The latter function takes a string pointer, so let's avoid the detour and hand the string to it directly. That's shorter, simpler and slightly more efficient. Signed-off-by: René Scharfe <[email protected]> Acked-by: Derrick Stolee <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 1771be9 commit d68ce90

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

commit-graph.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1590,19 +1590,15 @@ static void merge_commit_graphs(struct write_commit_graph_context *ctx)
15901590
{
15911591
struct commit_graph *g = ctx->r->objects->commit_graph;
15921592
uint32_t current_graph_number = ctx->num_commit_graphs_before;
1593-
struct strbuf progress_title = STRBUF_INIT;
15941593

15951594
while (g && current_graph_number >= ctx->num_commit_graphs_after) {
15961595
current_graph_number--;
15971596

1598-
if (ctx->report_progress) {
1599-
strbuf_addstr(&progress_title, _("Merging commit-graph"));
1600-
ctx->progress = start_delayed_progress(progress_title.buf, 0);
1601-
}
1597+
if (ctx->report_progress)
1598+
ctx->progress = start_delayed_progress(_("Merging commit-graph"), 0);
16021599

16031600
merge_commit_graph(ctx, g);
16041601
stop_progress(&ctx->progress);
1605-
strbuf_release(&progress_title);
16061602

16071603
g = g->base_graph;
16081604
}

0 commit comments

Comments
 (0)