Fix git repository viewer URLs so they support more variants of the Wikimedia URLs

I've tested this against the URLs that are exposed within gitblit and gerrit, specifically:

* https://gerrit.wikimedia.org/r/p/mediawiki/extensions/AbuseFilter.git
* ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/AbuseFilter.git
* https://gerrit.wikimedia.org/r/mediawiki/extensions/AbuseFilter
* ssh://stwalkerster@gerrit.wikimedia.org:29418/mediawiki/extensions/AbuseFilter
* https://stwalkerster@gerrit.wikimedia.org/r/mediawiki/extensions/AbuseFilter

Change-Id: I36008eced60e32d554a5801bae155611f259f2d1