Local repositories clone a blank repo

This commit is contained in:
Anthony Sottile 2017-02-15 12:47:13 -08:00
parent e704edb5e2
commit f000241dcb
15 changed files with 156 additions and 121 deletions

View file

@ -13,15 +13,14 @@ logger = logging.getLogger('pre_commit')
class Manifest(object):
def __init__(self, repo_path_getter, repo_url):
self.repo_path_getter = repo_path_getter
def __init__(self, repo_path, repo_url):
self.repo_path = repo_path
self.repo_url = repo_url
@cached_property
def manifest_contents(self):
repo_path = self.repo_path_getter.repo_path
default_path = os.path.join(repo_path, C.MANIFEST_FILE)
legacy_path = os.path.join(repo_path, C.MANIFEST_FILE_LEGACY)
default_path = os.path.join(self.repo_path, C.MANIFEST_FILE)
legacy_path = os.path.join(self.repo_path, C.MANIFEST_FILE_LEGACY)
if os.path.exists(legacy_path) and not os.path.exists(default_path):
logger.warning(
'{} uses legacy {} to provide hooks.\n'