Skip to content

Conversation

@daschuer
Copy link
Contributor

The issue happens because get_git_dir() returns git rev-parse --git-common-dir and not git rev-parse --git-dir as expected. This PR introduces get_git_common_dir() and uses it where the common dir is required and the local .git dir of the current working copy in all other cases.

This fixes #1972, false positives in case of worktrees.

This PR is in the draft state to debug CI issues.

@daschuer daschuer marked this pull request as draft February 17, 2022 22:25
@daschuer daschuer marked this pull request as ready for review February 18, 2022 09:43
@daschuer
Copy link
Contributor Author

All green now!

Copy link
Member

@asottile asottile left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fixes the conflicted state check when using work trees. pre-commit#1972
@asottile asottile merged commit d650160 into pre-commit:main Apr 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

wrong path in case of workdirs

2 participants