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


def _rev_exists(rev: str) -> bool:
return not subprocess.call(('git', 'rev-list', '--quiet', rev))
return not bool(
subprocess.call(
('git', 'cat-file', '-e', rev),
stderr=subprocess.DEVNULL,
),
)
Comment thread
ptarjan marked this conversation as resolved.


def _pre_push_ns(
Expand Down