Skip to content
Merged
6 changes: 5 additions & 1 deletion src/borg/archiver/extract_cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@

progress = args.progress
dry_run = args.dry_run
output_list = args.output_list
stdout = args.stdout
sparse = args.sparse
strip_components = args.strip_components
Expand Down Expand Up @@ -66,7 +67,10 @@

is_matched = matcher.match(orig_path)
log_prefix = "+" if is_matched else "-"
logging.getLogger("borg.output.list").info(f"{log_prefix} {remove_surrogates(item.path)}")

# Conditionally log based on the output_list flag
if output_list:
logging.getLogger("borg.output.list").info(f"{log_prefix} {remove_surrogates(item.path)}")

if is_matched:
# Preloading item chunks only if the item will be fetched
Expand All @@ -77,8 +81,8 @@
dir_item = dirs.pop(-1)
try:
archive.extract_item(dir_item, stdout=stdout)
except BackupError as e:
self.print_warning_instance(BackupWarning(remove_surrogates(dir_item.path), e))

Check warning on line 85 in src/borg/archiver/extract_cmd.py

View check run for this annotation

Codecov / codecov/patch

src/borg/archiver/extract_cmd.py#L84-L85

Added lines #L84 - L85 were not covered by tests

try:
if dry_run:
Expand Down
Loading