mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-18 08:34:41 +04:00
Local repositories clone a blank repo
This commit is contained in:
parent
e704edb5e2
commit
f000241dcb
15 changed files with 156 additions and 121 deletions
|
|
@ -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'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue