Skip to content

deduplicate filenames from git ls-files during conflicts#3708

Open
karlhillx wants to merge 3 commits into
pre-commit:mainfrom
karlhillx:dedup-conflict-files
Open

deduplicate filenames from git ls-files during conflicts#3708
karlhillx wants to merge 3 commits into
pre-commit:mainfrom
karlhillx:dedup-conflict-files

Conversation

@karlhillx

Copy link
Copy Markdown

pre-commit run --all-files lists conflicted paths multiple times because git ls-files -z returns one entry per stage for unmerged files. De-duplicated with dict.fromkeys to preserve order. Existing in_merge_conflict fixture covers the test.

Fixes #3706

karlhillx and others added 3 commits June 12, 2026 21:39
pre-commit run --all-files lists conflicted paths multiple times
because git ls-files -z returns one entry per stage for unmerged
files. De-duplicated with dict.fromkeys to preserve order.
Existing in_merge_conflict fixture covers the test.

Fixes pre-commit#3706
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.

Duplicate files when doing pre-commit run --all-files during git conflict

1 participant