summaryrefslogtreecommitdiff
path: root/progress.h
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2022-02-25 15:47:35 -0800
committerLibravatar Junio C Hamano <gitster@pobox.com>2022-02-25 15:47:35 -0800
commita47fcfe8712e3258d1c565cd654c9bd5312a5168 (patch)
tree4c724f397e890c6b233d253be279321505e2a3a4 /progress.h
parentMerge branch 'ds/sparse-checkout-requires-per-worktree-config' (diff)
parentpack-bitmap-write.c: don't return without stop_progress() (diff)
downloadtgif-a47fcfe8712e3258d1c565cd654c9bd5312a5168.tar.xz
Merge branch 'ab/only-single-progress-at-once'
Further tweaks on progress API. * ab/only-single-progress-at-once: pack-bitmap-write.c: don't return without stop_progress() progress API: unify stop_progress{,_msg}(), fix trace2 bug progress.c: refactor stop_progress{,_msg}() to use helpers progress.c: use dereferenced "progress" variable, not "(*p_progress)" progress.h: format and be consistent with progress.c naming progress.c tests: test some invalid usage progress.c tests: make start/stop commands on stdin progress.c test helper: add missing braces leak tests: fix a memory leak in "test-progress" helper
Diffstat (limited to 'progress.h')
-rw-r--r--progress.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/progress.h b/progress.h
index f1913acf73..3a945637c8 100644
--- a/progress.h
+++ b/progress.h
@@ -1,5 +1,6 @@
#ifndef PROGRESS_H
#define PROGRESS_H
+#include "gettext.h"
struct progress;
@@ -18,7 +19,9 @@ struct progress *start_sparse_progress(const char *title, uint64_t total);
struct progress *start_delayed_progress(const char *title, uint64_t total);
struct progress *start_delayed_sparse_progress(const char *title,
uint64_t total);
-void stop_progress(struct progress **progress);
-void stop_progress_msg(struct progress **progress, const char *msg);
-
+void stop_progress_msg(struct progress **p_progress, const char *msg);
+static inline void stop_progress(struct progress **p_progress)
+{
+ stop_progress_msg(p_progress, _("done"));
+}
#endif