Remove unnecessary complexity in _check_initialpaths_for_relpath().

This commit is contained in:
Christian Boelsen 2017-09-28 20:53:50 +01:00
parent 14b6380e5f
commit 794d4585d3
1 changed files with 2 additions and 5 deletions

View File

@ -522,11 +522,8 @@ class FSCollector(Collector):
def _check_initialpaths_for_relpath(self):
for initialpath in self.session._initialpaths:
parent_path = self.fspath
for _ in parent_path.parts():
if parent_path.samefile(initialpath):
return self.fspath.relto(initialpath.dirname)
parent_path = parent_path.__class__(parent_path.dirname)
if self.fspath.common(initialpath) == initialpath:
return self.fspath.relto(initialpath.dirname)
def _makeid(self):
relpath = self.fspath.relto(self.config.rootdir)