From: Junio C Hamano Date: Sun, 19 Mar 2023 22:03:11 +0000 (-0700) Subject: Merge branch 'jk/bundle-progress' X-Git-Tag: v2.41.0-rc0~150 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=12201fd756bad12c137343d5fd65200f4d0f192d;p=thirdparty%2Fgit.git Merge branch 'jk/bundle-progress' Simplify UI to control progress meter given by "git bundle" command. * jk/bundle-progress: bundle: turn on --all-progress-implied by default --- 12201fd756bad12c137343d5fd65200f4d0f192d diff --cc t/t6020-bundle-misc.sh index 7d40994991,6b905e1b83..8c7b25a281 --- a/t/t6020-bundle-misc.sh +++ b/t/t6020-bundle-misc.sh @@@ -566,44 -567,16 +567,56 @@@ test_expect_success 'cloning from filte grep "cannot clone from filtered bundle" err ' +test_expect_success 'verify catches unreachable, broken prerequisites' ' + test_when_finished rm -rf clone-from clone-to && + git init clone-from && + ( + cd clone-from && + git checkout -b base && + test_commit A && + git checkout -b tip && + git commit --allow-empty -m "will drop by shallow" && + git commit --allow-empty -m "will keep by shallow" && + git commit --allow-empty -m "for bundle, not clone" && + git bundle create tip.bundle tip~1..tip && + git reset --hard HEAD~1 && + git checkout base + ) && + BAD_OID=$(git -C clone-from rev-parse tip~1) && + TIP_OID=$(git -C clone-from rev-parse tip) && + git clone --depth=1 --no-single-branch \ + "file://$(pwd)/clone-from" clone-to && + ( + cd clone-to && + + # Set up broken history by removing shallow markers + git update-ref -d refs/remotes/origin/tip && + rm .git/shallow && + + # Verify should fail + test_must_fail git bundle verify \ + ../clone-from/tip.bundle 2>err && + grep "some prerequisite commits .* are not connected" err && + test_line_count = 1 err && + + # Unbundling should fail + test_must_fail git bundle unbundle \ + ../clone-from/tip.bundle 2>err && + grep "some prerequisite commits .* are not connected" err && + test_line_count = 1 err + ) +' + + test_expect_success 'bundle progress includes write phase' ' + GIT_PROGRESS_DELAY=0 \ + git bundle create --progress out.bundle --all 2>err && + grep 'Writing' err + ' + + test_expect_success TTY 'create --quiet disables all bundle progress' ' + test_terminal env GIT_PROGRESS_DELAY=0 \ + git bundle create --quiet out.bundle --all 2>err && + test_must_be_empty err + ' + test_done