Remove unnecessary ref variable.
Add a test for an incorrect bitbucket branch.