diff --git a/borgmatic/borg/repo_info.py b/borgmatic/borg/repo_info.py index ab66d99c..9924aa8d 100644 --- a/borgmatic/borg/repo_info.py +++ b/borgmatic/borg/repo_info.py @@ -37,6 +37,7 @@ def display_repository_info( if feature.available(feature.Feature.REPO_INFO, local_borg_version) else ('info',) ) + + (('--critical',) if repo_info_arguments.json else ()) + ( ('--info',) if logger.getEffectiveLevel() == logging.INFO and not repo_info_arguments.json diff --git a/tests/unit/borg/test_repo_info.py b/tests/unit/borg/test_repo_info.py index 09b5e1d0..a85837ff 100644 --- a/tests/unit/borg/test_repo_info.py +++ b/tests/unit/borg/test_repo_info.py @@ -141,7 +141,7 @@ def test_display_repository_info_with_log_info_and_json_suppresses_most_borg_out flexmock(module.environment).should_receive('make_environment') flexmock(module.borgmatic.config.paths).should_receive('get_working_directory').and_return(None) flexmock(module).should_receive('execute_command_and_capture_output').with_args( - ('borg', 'repo-info', '--log-json', '--json', '--repo', 'repo'), + ('borg', 'repo-info', '--critical', '--log-json', '--json', '--repo', 'repo'), environment=None, working_directory=None, borg_local_path='borg', @@ -219,7 +219,7 @@ def test_display_repository_info_with_log_debug_and_json_suppresses_most_borg_ou flexmock(module.environment).should_receive('make_environment') flexmock(module.borgmatic.config.paths).should_receive('get_working_directory').and_return(None) flexmock(module).should_receive('execute_command_and_capture_output').with_args( - ('borg', 'repo-info', '--log-json', '--json', '--repo', 'repo'), + ('borg', 'repo-info', '--critical', '--log-json', '--json', '--repo', 'repo'), environment=None, working_directory=None, borg_local_path='borg', @@ -255,7 +255,7 @@ def test_display_repository_info_with_json_calls_borg_with_json_flag(): flexmock(module.environment).should_receive('make_environment') flexmock(module.borgmatic.config.paths).should_receive('get_working_directory').and_return(None) flexmock(module).should_receive('execute_command_and_capture_output').with_args( - ('borg', 'repo-info', '--log-json', '--json', '--repo', 'repo'), + ('borg', 'repo-info', '--critical', '--log-json', '--json', '--repo', 'repo'), environment=None, working_directory=None, borg_local_path='borg',