mirror of
https://github.com/borgbackup/borg.git
synced 2024-12-25 01:06:50 +00:00
_process: remove an infrequently used micro-opt
st param was only given at the root paths of the recursion. we can just drop that and make the code simpler.
This commit is contained in:
parent
ce69fc1e19
commit
dca04ba538
1 changed files with 6 additions and 10 deletions
|
@ -490,7 +490,7 @@ def create_inner(archive, cache, fso):
|
|||
restrict_dev = None
|
||||
self._process(fso, cache, matcher, args.exclude_caches, args.exclude_if_present,
|
||||
args.keep_exclude_tags, skip_inodes, path, restrict_dev,
|
||||
read_special=args.read_special, dry_run=dry_run, st=st)
|
||||
read_special=args.read_special, dry_run=dry_run)
|
||||
if not dry_run:
|
||||
archive.save(comment=args.comment, timestamp=args.timestamp)
|
||||
if args.progress:
|
||||
|
@ -544,20 +544,17 @@ def create_inner(archive, cache, fso):
|
|||
|
||||
def _process(self, fso, cache, matcher, exclude_caches, exclude_if_present,
|
||||
keep_exclude_tags, skip_inodes, path, restrict_dev,
|
||||
read_special=False, dry_run=False, st=None):
|
||||
read_special=False, dry_run=False):
|
||||
"""
|
||||
Process *path* recursively according to the various parameters.
|
||||
|
||||
*st* (if given) is a *os.stat_result* object for *path*.
|
||||
|
||||
This should only raise on critical errors. Per-item errors must be handled within this method.
|
||||
"""
|
||||
try:
|
||||
recurse_excluded_dir = False
|
||||
if matcher.match(path):
|
||||
if st is None:
|
||||
with backup_io('stat'):
|
||||
st = os.stat(path, follow_symlinks=False)
|
||||
with backup_io('stat'):
|
||||
st = os.stat(path, follow_symlinks=False)
|
||||
else:
|
||||
self.print_file_status('x', path)
|
||||
# get out here as quickly as possible:
|
||||
|
@ -566,9 +563,8 @@ def _process(self, fso, cache, matcher, exclude_caches, exclude_if_present,
|
|||
# could trigger an error, e.g. if access is forbidden, see #3209.
|
||||
if not matcher.recurse_dir:
|
||||
return
|
||||
if st is None:
|
||||
with backup_io('stat'):
|
||||
st = os.stat(path, follow_symlinks=False)
|
||||
with backup_io('stat'):
|
||||
st = os.stat(path, follow_symlinks=False)
|
||||
recurse_excluded_dir = stat.S_ISDIR(st.st_mode)
|
||||
if not recurse_excluded_dir:
|
||||
return
|
||||
|
|
Loading…
Reference in a new issue