MR fails with ff and git hook
ZD: https://gitlab.zendesk.com/agent/tickets/23970
Reproduced on GitLab 8.7.5 and gitlab.com
Summary
Having merge requests set up with fast-forward and also a git hook with regular expression to validate the commit messages causes the MR to fail because of an error in the commit message. When doing this merge request when it's NOT fast-forward, it successfully merges.
Steps to reproduce
- Set project Merge method to
Fast-forward merge
- In Git Hooks use
^(breaking|feature|fix|refactor|test|cre|docs|revert)\: [\S ]+(\n\n[\S ]+)?|(\d+\.\d+\.\d+)|(Merge branch.*)
for commit message. - When committing use the following message
refactor: good commit message<https://domaincom/gl-test/changelog-testing/commit/0615302690090efb8ce5caf3b2cfa5ffa51ad96f>
- Open a new MR.
- Try the same procedure without ff as a MR method to see this pass.
Expected behavior
The commit message should be accepted as is the case with non ff MRs.
Relevant logs and/or screenshots
/cc @grzesiek would you mind taking a look at this?