- if not $refs_or_closes_or_no_issue.match(message)
- puts "\n[POLICY] All commits to master must include an issue using \"refs #\" or\n"
- puts "\n\"closes #\", or specify \"no issue #\"\n\n"
+ # Do not test when the commit is a no_ff merge (which will be rejected), because
+ # this test will complain about *every* commit in the merge otherwise, obscuring
+ # the real reason for the rejection (the no_ff merge)
+ if not no_ff and not $refs_or_closes_or_no_issue.match(message)
+ puts "\n[POLICY] All commits to master must include an issue using \"refs #\" or"
+ puts "\"closes #\", or specify \"no issue #\"\n"