Block8/PHPCI — pull request #489 by Libbux (2014-07-10 18:42:33+00:00)
Title: Fix issue Block8/PHPCI#484 - generate correct commit and branch links when a port is included in the reference URL

This pull request fixes issue Block8/PHPCI#484, which affects the generation of links to commits and branches on the project page.

When a project is added using the `ssh://foo@git.example.com:port/user/repo.git` form, the reference URL stored in the database includes the port number at the beginning. This is necessary as the port stored in the reference URL is used for cloning the repository, but it causes links to commits and branches on the project page (pictured below)

![screen shot 2014-07-10 at 01 29 33 am](https://cloud.githubusercontent.com/assets/2374543/3533078/5471dc88-07c9-11e4-88a9-552e4e52497e.png)

to point to `http://git.example.com/port/user/repo/commit|branch` (note that the port is included in the URL, thus malforming it and causing it to 404).

This pull request solves the problem by adding an *optional* boolean parameter to the `PHPCI\Model\Base\getReference()` method (`Model/Base/ProjectBase.php`).

If the parameter is set to `false` or simply not included (as to not inhibit the functionality of the rest of the codebase relying on this method), the method will return the reference URL *with* the port prefix, as the assumption is that the rest of the codebase still needs to be able to access the actual reference URL properly. However, when the parameter is set to `true`, the method returns a "link friendly" version which does not include the port number prefix.

I'll try and implement this in the other vendor-specific build models if this issue affects them, I just haven't had time to test this issue with those platforms yet.