diff --git a/rhodecode/lib/middleware/simplegit.py b/rhodecode/lib/middleware/simplegit.py --- a/rhodecode/lib/middleware/simplegit.py +++ b/rhodecode/lib/middleware/simplegit.py @@ -115,6 +115,10 @@ class SimpleGit(BaseVCSController): except: return HTTPInternalServerError()(environ, start_response) + # quick check if that dir exists... + if is_valid_repo(repo_name, self.basepath) is False: + return HTTPNotFound()(environ, start_response) + #====================================================================== # GET ACTION PULL or PUSH #====================================================================== @@ -181,10 +185,6 @@ class SimpleGit(BaseVCSController): repo_path = os.path.join(safe_str(self.basepath), safe_str(repo_name)) log.debug('Repository path is %s' % repo_path) - # quick check if that dir exists... - if is_valid_repo(repo_name, self.basepath) is False: - return HTTPNotFound()(environ, start_response) - try: #invalidate cache on push if action == 'push':