You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Judging from the docstrings and comments, add_target and add_targets are expected to update a Targets object with passed target paths, if they are relative to a targets directory base path (i.e. self._targets_directory).
However, they don't seem to take into account that Python's os.path.join ignores all path component arguments prior to a component that looks like an absolute path.
Current behavior:
Works as expected (?) if passed target path is relative to a targets directory base path or absolute but falls into the targets directory:
Fails if the passed target path is not absolute and does not exist relative to targets directory base path "/path/to/repo/targets".
# repo._targets_directory == "/path/to/repo/targets"repo.targets.add_target("repo/targets/foo.txt")
# Fails with "'/path/to/repo/targets/repo/targets/foo.txt' is not a valid file in the repository's targets directory"
Fails if the passed target path is absolute and does not exist
#repo._targets_directory == "/path/to/repo/targets"repo.targets.add_target("/path/does/not/exist/foo.txt")
# Fails with "'/path/does/not/exist/foo.txt' is not a valid file in the repository's targets directory"
Has unexpected behavior if the passed path is absolute and exists!