Details
-
Bug
-
Resolution: Fixed
-
Low
-
5.16.11, 6.10.3, 7.1.1
-
None
-
1
-
Severity 3 - Minor
-
Description
Issue Summary
When admins install unexpected hooks on Bitbucket Server instances, running those hooks can cause failures trying to merge pull requests.
Steps to Reproduce
- Install a hook script, like commit-msg or pre-commit (The exact steps are not provided because it's not a supported behavior to do this.)
- Try to merge a pull request
Expected Results
The unexpected hook(s) are not invoked and the pull request merges successfully.
Actual Results
The unexpected hook(s) are run and the merge fails if any a hook blocks it.
One example of an exception caused by an unexpected hook blocking a pull request merge:
Caused by: com.atlassian.bitbucket.scm.CommandFailedException: '/usr/bin/git merge -m Merge pull request #111 in KEY/slug from feature/some-really-cool-feature to master --no-ff --log=20 --allow-unrelated-histories 86c2bfa97dadd1896c8365176a785a2748fa7308' exited with code 1 saying: Invalid git commit message. ['Line 4 is longer than 72 chars', 'Line 7 is longer than 72 chars', 'Line 9 is longer than 72 chars'] Not committing merge; use 'git commit' to complete the merge.
Workaround
Uninstall the unexpected hooks. Script hooks on actions like commit-msg, pre-commit and similar are not supported.