For the "mount" action, fix use of "--log-json" when "--foreground" is set (#485).

This commit is contained in:
Dan Helfman
2026-01-09 12:01:21 -08:00
parent 6f4f1fa16e
commit 528dc6fe87
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -32,7 +32,7 @@ def mount_archive(
(local_path, 'mount')
+ (('--remote-path', remote_path) if remote_path else ())
+ (('--umask', str(umask)) if umask else ())
+ ('--log-json',)
+ (('--log-json',) if not mount_arguments.foreground else ())
+ (('--lock-wait', str(lock_wait)) if lock_wait else ())
+ (('--info',) if logger.getEffectiveLevel() == logging.INFO else ())
+ (('--debug', '--show-rc') if logger.isEnabledFor(logging.DEBUG) else ())
+1 -1
View File
@@ -273,7 +273,7 @@ def test_mount_archive_calls_borg_with_foreground_parameter():
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').with_args(
('borg', 'mount', '--log-json', '--foreground', 'repo::archive', '/mnt'),
('borg', 'mount', '--foreground', 'repo::archive', '/mnt'),
output_file=module.DO_NOT_CAPTURE,
environment=None,
working_directory=None,