mirror of
https://github.com/borgmatic-collective/borgmatic.git
synced 2026-08-03 07:03:00 +02:00
Merge branch 'main' into reduce-path-validation-memory-consumption
This commit is contained in:
@@ -81,7 +81,6 @@ def create_repository(
|
||||
if feature.available(feature.Feature.REPO_CREATE, local_borg_version)
|
||||
else ('init',)
|
||||
)
|
||||
+ ('--log-json',)
|
||||
+ (('--encryption', encryption_mode) if encryption_mode else ())
|
||||
+ (('--other-repo', source_repository) if source_repository else ())
|
||||
+ (('--copy-crypt-key',) if copy_crypt_key else ())
|
||||
|
||||
@@ -49,9 +49,8 @@ def display_repository_info(
|
||||
)
|
||||
+ flags.make_flags('remote-path', remote_path)
|
||||
+ flags.make_flags('umask', config.get('umask'))
|
||||
+ ('--log-json',)
|
||||
+ flags.make_flags('lock-wait', lock_wait)
|
||||
+ (('--json',) if repo_info_arguments.json else ())
|
||||
+ (('--json',) if repo_info_arguments.json else ('--log-json',))
|
||||
+ (tuple(shlex.split(extra_borg_options)) if extra_borg_options else ())
|
||||
+ flags.make_repository_flags(repository_path, local_borg_version)
|
||||
)
|
||||
|
||||
@@ -9,7 +9,7 @@ from borgmatic.borg import repo_create as module
|
||||
from ..test_verbosity import insert_logging_mock
|
||||
|
||||
REPO_INFO_SOME_UNKNOWN_EXIT_CODE = -999
|
||||
REPO_CREATE_COMMAND = ('borg', 'repo-create', '--log-json', '--encryption', 'repokey')
|
||||
REPO_CREATE_COMMAND = ('borg', 'repo-create', '--encryption', 'repokey')
|
||||
|
||||
|
||||
def insert_repo_info_command_found_mock():
|
||||
|
||||
@@ -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', '--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', '--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', '--json', '--repo', 'repo'),
|
||||
environment=None,
|
||||
working_directory=None,
|
||||
borg_local_path='borg',
|
||||
@@ -458,16 +458,9 @@ def test_display_repository_info_with_lock_wait_calls_borg_with_lock_wait_flags(
|
||||
)
|
||||
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', '--lock-wait', '5', '--json', '--repo', 'repo'),
|
||||
environment=None,
|
||||
working_directory=None,
|
||||
borg_local_path='borg',
|
||||
borg_exit_codes=None,
|
||||
).and_yield('[]')
|
||||
flexmock(module.flags).should_receive('warn_for_aggressive_archive_flags')
|
||||
flexmock(module).should_receive('execute_command').with_args(
|
||||
('borg', 'repo-info', '--log-json', '--lock-wait', '5', '--repo', 'repo'),
|
||||
('borg', 'repo-info', '--lock-wait', '5', '--log-json', '--repo', 'repo'),
|
||||
output_log_level=module.borgmatic.logger.ANSWER,
|
||||
environment=None,
|
||||
working_directory=None,
|
||||
|
||||
Reference in New Issue
Block a user