Skip to content

Commit 1558d06

Browse files
authored
Merge pull request #3726 from pre-commit/exists-faster
faster check of rev existing locally as a commit
2 parents 3613bf2 + 2e01c99 commit 1558d06

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

pre_commit/commands/hook_impl.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ def _ns(
114114

115115

116116
def _rev_exists(rev: str) -> bool:
117-
return not subprocess.call(('git', 'rev-list', '--quiet', rev))
117+
return not subprocess.call(('git', 'cat-file', '-e', f'{rev}^{{commit}}'))
118118

119119

120120
def _pre_push_ns(

0 commit comments

Comments
 (0)