if not all_files:
external_files = []
for x in tracked_files:
relpath = os.path.relpath(x, ".")
if relpath.startswith(".."):
env.logger.info("{} is excluded. Use option --all to include tracked files outside of current directory.".format(x))
external_files.append(x)
tracked_files -= set(external_files)
After Change
if not all_files:
external_files = []
for x in tracked_files:
if FileTarget(x).is_external():
env.logger.info("{} is excluded. Use option --all to include tracked files outside of current directory.".format(x))
external_files.append(x)
tracked_files -= set(external_files)