Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion lib/overcommit/hook_context/helpers/file_modifications.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ def amendment?
cmd = Overcommit::Utils.parent_command
return unless cmd

amend_pattern = 'commit(\s.*)?\s--amend(\s|$)'
# POSIX character class rather than `\s`, which macOS git's regex
# library does not support
amend_pattern = 'commit([[:space:]].*)?[[:space:]]--amend([[:space:]]|$)'

# Since the ps command can return invalid byte sequences for commands
# containing unicode characters, we replace the offending characters,
Expand Down
Loading