From 5d95ba8d85e189c25195beae9431d5f6823e083a Mon Sep 17 00:00:00 2001 From: Gavin Mak Date: Thu, 26 Jun 2025 18:08:34 +0000 Subject: progress: Make end() idempotent This fixes the double "done" text on successful interleaved sync. Bug: 421935613 Change-Id: I4f01418cb0340129a8f0a2a5835f7e3fa6a6b119 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/487081 Reviewed-by: Scott Lee Tested-by: Gavin Mak Commit-Queue: Gavin Mak --- progress.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'progress.py') diff --git a/progress.py b/progress.py index a386f426..31a4890a 100644 --- a/progress.py +++ b/progress.py @@ -101,6 +101,7 @@ class Progress: self._units = units self._elide = elide and _TTY self._quiet = quiet + self._ended = False # Only show the active jobs section if we run more than one in parallel. self._show_jobs = False @@ -211,6 +212,10 @@ class Progress: self.update(inc=0) def end(self): + if self._ended: + return + self._ended = True + self._update_event.set() if not _TTY or IsTraceToStderr() or self._quiet: return -- cgit v1.2.3-54-g00ecf