diff options
author | Ævar Arnfjörð Bjarmason <avarab@gmail.com> | 2022-02-03 21:40:18 (GMT) |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2022-02-03 23:39:59 (GMT) |
commit | 74900a6b3513e0908b1d16df7855e9d478b20b91 (patch) | |
tree | 09dfd1820aaf89f34dd5c02842a09472e44988d4 /t | |
parent | accf1eb1d0f102c6b8f099fa6063216818e45c6b (diff) | |
download | git-74900a6b3513e0908b1d16df7855e9d478b20b91.zip git-74900a6b3513e0908b1d16df7855e9d478b20b91.tar.gz git-74900a6b3513e0908b1d16df7855e9d478b20b91.tar.bz2 |
progress API: unify stop_progress{,_msg}(), fix trace2 bug
Fix a bug that's been with us ever since 98a13647408 (trace2: log
progress time and throughput, 2020-05-12), when the
stop_progress_msg() API was used we didn't log a "region_leave" for
the "region_enter" we start in "start_progress_delay()".
The only user of the "stop_progress_msg()" function is
"index-pack". Let's add a previously failing test to check that we
have the same number of "region_enter" and "region_leave" events, with
"-v" we'll log progress even in the test environment.
In addition to that we've had a submarine bug here introduced with
9d81ecb52b5 (progress: add sparse mode to force 100% complete message,
2019-03-21). The "start_sparse_progress()" API would only do the right
thing if the progress was ended with "stop_progress()", not
"stop_progress_msg()".
The only user of that API uses "stop_progress()", but let's still fix
that along with the trace2 issue by making "stop_progress()" a trivial
wrapper for "stop_progress_msg()".
We can also drop the "if (progress)" test from
"finish_if_sparse()". It's now a helper for the small
"stop_progress_msg()" function. We'll already have returned from it if
"progress" is "NULL".
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-x | t/t5316-pack-delta-depth.sh | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/t/t5316-pack-delta-depth.sh b/t/t5316-pack-delta-depth.sh index 759169d..bbe2e69 100755 --- a/t/t5316-pack-delta-depth.sh +++ b/t/t5316-pack-delta-depth.sh @@ -61,7 +61,11 @@ test_expect_success 'create series of packs' ' echo $cur echo "$(git rev-parse :file) file" } | git pack-objects --stdout >tmp && - git index-pack --stdin --fix-thin <tmp || return 1 + GIT_TRACE2_EVENT=$PWD/trace \ + git index-pack -v --stdin --fix-thin <tmp || return 1 && + grep -c region_enter.*progress trace >enter && + grep -c region_leave.*progress trace >leave && + test_cmp enter leave && prev=$cur done ' |