X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FGitInfo.php;h=4351acc0e9b85ccf8385ef8a3b59de8f85af0a30;hb=0becca63c3e090760044b3df9fc9c4e078a1cb39;hp=29516ab7cd9494499823fc8293bee602396c569e;hpb=f2b09f04f22a64e3f65bd6728902736434f71f00;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/GitInfo.php b/includes/GitInfo.php index 29516ab7cd..4351acc0e9 100644 --- a/includes/GitInfo.php +++ b/includes/GitInfo.php @@ -46,7 +46,7 @@ class GitInfo { protected $cache = []; /** - * Map of repo URLs to viewer URLs. Access via static method getViewers(). + * @var array|false Map of repo URLs to viewer URLs. Access via static method getViewers(). */ private static $viewers = false; @@ -257,9 +257,6 @@ class GitInfo { if ( $url === false ) { return false; } - if ( substr( $url, -4 ) !== '.git' ) { - $url .= '.git'; - } foreach ( self::getViewers() as $repo => $viewer ) { $pattern = '#^' . $repo . '$#'; if ( preg_match( $pattern, $url, $matches ) ) { @@ -269,6 +266,7 @@ class GitInfo { '%h' => substr( $headSHA1, 0, 7 ), '%H' => $headSHA1, '%r' => urlencode( $matches[1] ), + '%R' => $matches[1], ]; return strtr( $viewerUrl, $replacements ); }