summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRené Scharfe <l.s.r@web.de>2020-02-20 18:49:18 (GMT)
committerJunio C Hamano <gitster@pobox.com>2020-02-27 17:36:22 (GMT)
commitd68ce906c7e1b2bb28a389b915cb63ddbae43365 (patch)
tree1061bcae771f67621d223d3849cbd8ed41026b45
parent1771be90c8e4797c2466296d1d570dbfa39d9743 (diff)
downloadgit-d68ce906c7e1b2bb28a389b915cb63ddbae43365.zip
git-d68ce906c7e1b2bb28a389b915cb63ddbae43365.tar.gz
git-d68ce906c7e1b2bb28a389b915cb63ddbae43365.tar.bz2
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 <l.s.r@web.de> Acked-by: Derrick Stolee <dstolee@microsoft.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--commit-graph.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/commit-graph.c b/commit-graph.c
index fb31009..e167378 100644
--- a/commit-graph.c
+++ b/commit-graph.c
@@ -1590,19 +1590,15 @@ static void merge_commit_graphs(struct write_commit_graph_context *ctx)
{
struct commit_graph *g = ctx->r->objects->commit_graph;
uint32_t current_graph_number = ctx->num_commit_graphs_before;
- struct strbuf progress_title = STRBUF_INIT;
while (g && current_graph_number >= ctx->num_commit_graphs_after) {
current_graph_number--;
- if (ctx->report_progress) {
- strbuf_addstr(&progress_title, _("Merging commit-graph"));
- ctx->progress = start_delayed_progress(progress_title.buf, 0);
- }
+ if (ctx->report_progress)
+ ctx->progress = start_delayed_progress(_("Merging commit-graph"), 0);
merge_commit_graph(ctx, g);
stop_progress(&ctx->progress);
- strbuf_release(&progress_title);
g = g->base_graph;
}