Merge branches before building on CI.

Reduces bugs on master arising from post-test merges.
If the merge fails and it aborts, will this interrupt the Jenkins job in any way? Should the Bash script exit with a non-zero exit code to indicate that the branch doesn't merge cleanly?