Переглянути джерело

Support status character changes in Borg 2.0.0b5 when filtering out special files that cause Borg to hang.

Dan Helfman 2 роки тому
батько
коміт
d7a07f0428
2 змінених файлів з 4 додано та 4 видалено
  1. 1 1
      borgmatic/borg/create.py
  2. 3 3
      tests/unit/borg/test_create.py

+ 1 - 1
borgmatic/borg/create.py

@@ -275,7 +275,7 @@ def collect_special_file_paths(
     paths = tuple(
         path_line.split(' ', 1)[1]
         for path_line in paths_output.split('\n')
-        if path_line and path_line.startswith('- ')
+        if path_line and path_line.startswith('- ') or path_line.startswith('+ ')
     )
 
     return tuple(

+ 3 - 3
tests/unit/borg/test_create.py

@@ -358,7 +358,7 @@ def test_any_parent_directories_treats_unrelated_paths_as_non_match():
 
 def test_collect_special_file_paths_parses_special_files_from_borg_dry_run_file_list():
     flexmock(module).should_receive('execute_command_and_capture_output').and_return(
-        'Processing files ...\n- /foo\n- /bar\n- /baz'
+        'Processing files ...\n- /foo\n+ /bar\n- /baz'
     )
     flexmock(module).should_receive('special_file').and_return(True)
     flexmock(module).should_receive('any_parent_directories').and_return(False)
@@ -374,7 +374,7 @@ def test_collect_special_file_paths_parses_special_files_from_borg_dry_run_file_
 
 def test_collect_special_file_paths_excludes_requested_directories():
     flexmock(module).should_receive('execute_command_and_capture_output').and_return(
-        '- /foo\n- /bar\n- /baz'
+        '+ /foo\n- /bar\n- /baz'
     )
     flexmock(module).should_receive('special_file').and_return(True)
     flexmock(module).should_receive('any_parent_directories').and_return(False).and_return(
@@ -392,7 +392,7 @@ def test_collect_special_file_paths_excludes_requested_directories():
 
 def test_collect_special_file_paths_excludes_non_special_files():
     flexmock(module).should_receive('execute_command_and_capture_output').and_return(
-        '- /foo\n- /bar\n- /baz'
+        '+ /foo\n+ /bar\n+ /baz'
     )
     flexmock(module).should_receive('special_file').and_return(True).and_return(False).and_return(
         True