Skip to content

Commit a976ee0

Browse files
Fix fetching specific tag from remote.
`get_hash_in_repo` failed when run with `fetch=True` when `extensions.partialClone` wasn't set in the repo. This config option is set now before fetching. * check_pre_commit_config_frozen.py
1 parent 13e489d commit a976ee0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

check_pre_commit_config_frozen.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,7 @@ async def get_hash_in_repo(repo_path: str, rev: str, fetch=True) -> str:
309309
"""
310310
_git = ("git", *NO_FS_MONITOR, "-C", repo_path)
311311
if fetch:
312+
await cmd_output(*_git, "config", "extensions.partialClone", "true")
312313
await cmd_output(
313314
*_git,
314315
"fetch",
@@ -984,7 +985,7 @@ async def main():
984985
rules = set()
985986
if options.strict:
986987
rules = set("ycfamt")
987-
elif not options.rules:
988+
elif not options.rules and options.disable:
988989
rules = set(r.value for r in Rule)
989990
rules |= set(options.rules)
990991
rules -= set(options.disable)

0 commit comments

Comments
 (0)