Skip to content

Commit

Permalink
fix: Explicitly disable paging in pre-commit hook (#3928)
Browse files Browse the repository at this point in the history
The pre-commit hook that checks for leftover conflict markers introduced in #3708 calls git diff. While this works well in general, I am running into an edge case where git is failing to determine that it is not being run in a TTY, causing it to fire up a pager which, in turn, causes pre-commit to hang as it waits for the pager to close. This commit fixes this issue by adding the `--no-pager` flag to the git command.
  • Loading branch information
stephenswat authored Dec 2, 2024
1 parent 4a506f8 commit 6cbf203
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ repos:
- id: leftover_conflict_markers
name: Leftover conflict markers
language: system
entry: git diff --staged --check
entry: git --no-pager diff --staged --check

- repo: local
hooks:
Expand Down

0 comments on commit 6cbf203

Please sign in to comment.