FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Support shebang executable checks outside git repos by liangchen0202 · Pull Request #1283 · pre-commit/pre-commit-hooks · GitHub

Repository navigation

Support shebang executable checks outside git repos - #1283

Closed
liangchen0202 wants to merge 1 commit into
pre-commit:mainfrom
liangchen0202:issue-749-no-git-filemode
Closed

liangchen0202 wants to merge 1 commit into
pre-commit:mainfrom
liangchen0202:issue-749-no-git-filemode

Conversation

Copy link
Copy Markdown

Fixes #749.

This updates check-shebang-scripts-are-executable to use the file system's executable bit when git config core.fileMode does not return false, while keeping the existing Git index fallback when core.fileMode=false.

This allows hooks to run outside of a Git repository while maintaining existing behavior on file systems where the executable bit can't be trusted.

Tests:

  • Added parametrized tests for files outside a Git repository with and without shebangs and executable bits.
  • Full test suite passes locally on Windows: 402 passed, 17 skipped, 2 xfailed.
  • Coverage remains at 100%.
  • The new non-Git tests are skipped on Windows and run on supported Unix-like environments.

asottile closed this Oct 18, 2026
pre-commit locked as spam and limited conversation to collaborators Oct 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Development

Successfully merging this pull request may close these issues.

check-shebang-scripts-are-executable Assumes Git Repo

2 participants


Back | FazBrowse Home | New Git URL