1
0
Fork 0
mirror of https://github.com/borgbackup/borg.git synced 2024-12-25 01:06:50 +00:00

fix fso.stats updating

fso is None in dry_run mode.
This commit is contained in:
Thomas Waldmann 2022-12-15 18:10:36 +01:00
parent 19e25043b5
commit 61e5115d1d
No known key found for this signature in database
GPG key ID: 243ACFA951F78E01

View file

@ -118,7 +118,8 @@ def create_inner(archive, cache, fso):
if status == "C":
self.print_warning("%s: file changed while we backed it up", path)
self.print_file_status(status, path)
fso.stats.files_stats[status] += 1
if not dry_run and status is not None:
fso.stats.files_stats[status] += 1
if args.paths_from_command:
rc = proc.wait()
if rc != 0:
@ -142,7 +143,8 @@ def create_inner(archive, cache, fso):
else:
status = "-"
self.print_file_status(status, path)
fso.stats.files_stats[status] += 1
if not dry_run and status is not None:
fso.stats.files_stats[status] += 1
continue
path = os.path.normpath(path)
parent_dir = os.path.dirname(path) or "."
@ -475,7 +477,7 @@ def _rec_walk(
self.print_warning("%s: file changed while we backed it up", path)
if not recurse_excluded_dir:
self.print_file_status(status, path)
if status is not None:
if not dry_run and status is not None:
fso.stats.files_stats[status] += 1
def build_parser_create(self, subparsers, common_parser, mid_common_parser):