diff options
author | Tom Hughes <tom@compton.nu> | 2024-05-25 12:09:27 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2024-05-26 18:17:08 +0200 |
commit | 7e17d954d8325824c40d0441eb10888d5178755e (patch) | |
tree | 564674b2926c9047159d62d59d18b109886796a8 /t/t0410-partial-clone.sh | |
parent | Git 2.45 (diff) | |
download | git-7e17d954d8325824c40d0441eb10888d5178755e.tar.xz git-7e17d954d8325824c40d0441eb10888d5178755e.zip |
promisor-remote: add promisor.quiet configuration option
Add a configuration option to allow output from the promisor
fetching objects to be suppressed.
This allows us to stop commands like 'git blame' being swamped
with progress messages and gc notifications from the promisor
when used in a partial clone.
Signed-off-by: Tom Hughes <tom@compton.nu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to '')
-rwxr-xr-x | t/t0410-partial-clone.sh | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/t/t0410-partial-clone.sh b/t/t0410-partial-clone.sh index 88a66f0904..8d468eb170 100755 --- a/t/t0410-partial-clone.sh +++ b/t/t0410-partial-clone.sh @@ -3,6 +3,7 @@ test_description='partial clone' . ./test-lib.sh +. "$TEST_DIRECTORY"/lib-terminal.sh # missing promisor objects cause repacks which write bitmaps to fail GIT_TEST_MULTI_PACK_INDEX_WRITE_BITMAP=0 @@ -689,6 +690,48 @@ test_expect_success 'lazy-fetch when accessing object not in the_repository' ' ! grep "[?]$FILE_HASH" out ' +test_expect_success 'setup for promisor.quiet tests' ' + rm -rf server && + test_create_repo server && + test_commit -C server foo && + git -C server rm foo.t && + git -C server commit -m remove && + git -C server config uploadpack.allowanysha1inwant 1 && + git -C server config uploadpack.allowfilter 1 +' + +test_expect_success TTY 'promisor.quiet=false shows progress messages' ' + rm -rf repo && + git clone --filter=blob:none "file://$(pwd)/server" repo && + git -C repo config promisor.quiet "false" && + + test_terminal git -C repo cat-file -p foo:foo.t 2>err && + + # Ensure that progress messages are written + grep "Receiving objects" err +' + +test_expect_success TTY 'promisor.quiet=true does not show progress messages' ' + rm -rf repo && + git clone --filter=blob:none "file://$(pwd)/server" repo && + git -C repo config promisor.quiet "true" && + + test_terminal git -C repo cat-file -p foo:foo.t 2>err && + + # Ensure that no progress messages are written + ! grep "Receiving objects" err +' + +test_expect_success TTY 'promisor.quiet=unconfigured shows progress messages' ' + rm -rf repo && + git clone --filter=blob:none "file://$(pwd)/server" repo && + + test_terminal git -C repo cat-file -p foo:foo.t 2>err && + + # Ensure that progress messages are written + grep "Receiving objects" err +' + . "$TEST_DIRECTORY"/lib-httpd.sh start_httpd |