Skip to content

Commit 46f15af

Browse files
committed
Fix CaseConflicts handling to work with larger file sets
When running `overcommit --run` with a large set of files, `CaseConflicts` would call `git ls-tree` with an argument list too large for the OS to handle. This was exacerbated by the fact that we were passing the same directory multiple times since we were not returning the unique set of directories.
1 parent 9178641 commit 46f15af

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
* Fix pre-commit hook bug where amending a commit which breaks a symlink would
66
result in that symlink not being included in the list of modified files
7+
* Fix `CaseConflicts` pre-commit hook handling of large sets of files
78

89
## 0.26.0
910

lib/overcommit/hook/pre_commit/case_conflicts.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ def run
66
repo_files = Set.new(applicable_files)
77

88
unless Overcommit::GitRepo.initial_commit?
9-
paths = repo_files.map { |file| File.dirname(file) + File::SEPARATOR }
9+
paths = repo_files.map { |file| File.dirname(file) + File::SEPARATOR }.uniq
1010
repo_files += Overcommit::GitRepo.list_files(paths)
1111
end
1212

0 commit comments

Comments
 (0)