From 0c66b24a12f27b0e85c31439f690d0bde2f67fff Mon Sep 17 00:00:00 2001 From: Jan Kiszka Date: Fri, 24 Aug 2018 19:18:01 +0200 Subject: [PATCH] repos: Remove environ parameter from get_root_path() This is just the default, namely the environment from the global context. Signed-off-by: Jan Kiszka --- kas/repos.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/kas/repos.py b/kas/repos.py index f4888e9..9b79b33 100644 --- a/kas/repos.py +++ b/kas/repos.py @@ -100,8 +100,7 @@ class Repo: if url is None: # No version control operation on repository if path is None: - path = Repo.get_root_path(os.path.dirname(config.filename), - config.context.environ) + path = Repo.get_root_path(os.path.dirname(config.filename)) logging.info('Using %s as root for repository %s', path, name) @@ -124,19 +123,17 @@ class Repo: raise NotImplementedError('Repo typ "%s" not supported.' % typ) @staticmethod - def get_root_path(path, environ): + def get_root_path(path): """ Check if path is a version control repo and return its root path. """ (ret, output) = run_cmd(['git', 'rev-parse', '--show-toplevel'], - cwd=path, env=environ, fail=False, - liveupdate=False) + cwd=path, fail=False, liveupdate=False) if ret == 0: return output.strip() (ret, output) = run_cmd(['hg', 'root'], - cwd=path, env=environ, fail=False, - liveupdate=False) + cwd=path, fail=False, liveupdate=False) if ret == 0: return output.strip()