Skip to content

Commit 9c62b0c

Browse files
committed
Merge pull request sds#347 from jawshooah/message-pattern-ignore-empty
Don't fail on empty message in MessageFormat hook
2 parents b68ebf1 + e349ade commit 9c62b0c

File tree

2 files changed

+0
-8
lines changed

2 files changed

+0
-8
lines changed

lib/overcommit/hook/commit_msg/message_format.rb

-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ module Overcommit::Hook::CommitMsg
22
# Ensures the commit message follows a specific format.
33
class MessageFormat < Base
44
def run
5-
return :fail, "Empty message not allowed." if empty_message?
6-
75
error_msg = validate_pattern(commit_message_lines.join("\n"))
86
return :fail, error_msg if error_msg
97

spec/overcommit/hook/commit_msg/message_format_spec.rb

-6
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,6 @@
1010
context.stub(:empty_message?).and_return(commit_msg.empty?)
1111
end
1212

13-
context 'when commit message is empty' do
14-
let(:commit_msg) { '' }
15-
16-
it { should fail_hook }
17-
end
18-
1913
context 'when pattern is empty' do
2014
let(:config) do
2115
super().merge(Overcommit::Configuration.new(

0 commit comments

Comments
 (0)