File tree 2 files changed +12
-2
lines changed
lib/overcommit/hook/commit_msg
spec/overcommit/hook/commit_msg
2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change 7
7
8
8
@errors = [ ]
9
9
10
- find_errors_in_subject ( commit_message_lines . first )
10
+ find_errors_in_subject ( commit_message_lines . first . chomp )
11
11
find_errors_in_body ( commit_message_lines )
12
12
13
13
return :warn , @errors . join ( "\n " ) if @errors . any?
Original file line number Diff line number Diff line change 6
6
subject { described_class . new ( config , context ) }
7
7
8
8
before do
9
- context . stub ( :commit_message_lines ) . and_return ( commit_msg . split ( " \n " ) )
9
+ context . stub ( :commit_message_lines ) . and_return ( commit_msg . lines )
10
10
context . stub ( :empty_message? ) . and_return ( commit_msg . empty? )
11
11
end
12
12
28
28
it { should pass }
29
29
end
30
30
31
+ context 'when the subject is 60 characters followed by a newline' do
32
+ let ( :commit_msg ) { <<-MSG }
33
+ This is 60 characters, or 61 if the newline is counted
34
+
35
+ A reasonable line.
36
+ MSG
37
+
38
+ it { should pass }
39
+ end
40
+
31
41
context 'when a line in the message is 72 characters followed by a newline' do
32
42
let ( :commit_msg ) { <<-MSG }
33
43
Some summary
You can’t perform that action at this time.
0 commit comments