diff --git a/@commitlint/is-ignored/src/index.js b/@commitlint/is-ignored/src/index.js index 839786d2ab..3d25e236d7 100644 --- a/@commitlint/is-ignored/src/index.js +++ b/@commitlint/is-ignored/src/index.js @@ -3,7 +3,7 @@ import semver from 'semver'; const WILDCARDS = [ c => c.match( - /^(Merge pull request)|(Merge (.*?) into (.*?)|(Merge branch (.*?))(?:\r?\n)*$)/ + /^((Merge pull request)|(Merge (.*?) into (.*?)|(Merge branch (.*?)))(?:\r?\n)*$)/ ), c => c.match(/^(R|r)evert (.*)/), c => c.match(/^(fixup|squash)!/), diff --git a/@commitlint/is-ignored/src/index.test.js b/@commitlint/is-ignored/src/index.test.js index f20faef602..961343b646 100644 --- a/@commitlint/is-ignored/src/index.test.js +++ b/@commitlint/is-ignored/src/index.test.js @@ -107,3 +107,7 @@ test('should return true for bitbucket merge commits', t => { test('should return true for automatic merge commits', t => { t.true(isIgnored('Auto-merged develop into master')); }); + +test('should return false for commits containing, but not starting, with merge branch', t => { + t.false(isIgnored('foo bar Merge branch xxx')); +});