Skip to content
5 changes: 4 additions & 1 deletion pre_commit/commands/hook_impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,10 @@ def _ns(


def _rev_exists(rev: str) -> bool:
return not subprocess.call(('git', 'rev-list', '--quiet', rev))
return not subprocess.call(
('git', 'cat-file', '-e', rev),
stderr=subprocess.DEVNULL,
)


def _pre_push_ns(
Expand Down