Visitar URL original
use git cat-file -e instead of git rev-list in _rev_exists by ptarjan · Pull Request #3605 · pre-commit/pre-commit · GitHub
Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
line length
  • Loading branch information
ptarjan committed Dec 26, 2025
commit 7b1d351330b65188e20be905236dcdf48095f536
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 subprocess.call(('git', 'cat-file', '-e', rev), stderr=subprocess.DEVNULL) == 0
return subprocess.call(
('git', 'cat-file', '-e', rev),
stderr=subprocess.DEVNULL,
) == 0


def _pre_push_ns(
Expand Down