scm: require abs path

Fixes #1136

Signed-off-by: Ruslan Kuprieiev <[email protected]>
This commit is contained in:
Ruslan Kuprieiev
2018-09-20 00:14:16 +03:00
parent 04efd1d6d3
commit e1841f07cb
2 changed files with 6 additions and 6 deletions
+2 -3
View File
@@ -109,10 +109,9 @@ class Git(Base):
return self.GITIGNORE
def _get_gitignore(self, path):
assert os.path.isabs(path)
entry = os.path.basename(path)
gitignore = os.path.join(os.path.abspath(os.path.dirname(path)),
self.GITIGNORE)
gitignore = os.path.abspath(os.path.realpath(gitignore))
gitignore = os.path.join(os.path.dirname(path), self.GITIGNORE)
if not gitignore.startswith(self.root_dir):
raise FileNotInRepoError(path)