From fa2da7ab6754814352bc70ce1647a564e85185bb Mon Sep 17 00:00:00 2001 From: Marcin Kuzminski Date: Wed, 19 Sep 2018 14:19:45 +0200 Subject: [PATCH] import/repo-checks: skip validating storage path in detection of SCMs. --- rhodecode/lib/utils.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/rhodecode/lib/utils.py b/rhodecode/lib/utils.py index 3b80fbf4..9ae3d33a 100644 --- a/rhodecode/lib/utils.py +++ b/rhodecode/lib/utils.py @@ -299,9 +299,13 @@ def is_valid_repo_group(repo_group_name, base_path, skip_path_check=False): # we need to check bare git repos at higher level # since we might match branches/hooks/info/objects or possible # other things inside bare git repo - scm_ = get_scm(os.path.dirname(full_path)) - log.debug('path: %s is a vcs object:%s, not valid ' - 'repo group' % (full_path, scm_)) + maybe_repo = os.path.dirname(full_path) + if maybe_repo == base_path: + # skip root level repo check, we know root location CANNOT BE a repo group + return False + + scm_ = get_scm(maybe_repo) + log.debug('path: %s is a vcs object:%s, not valid repo group', full_path, scm_) return False except VCSError: pass