From 364b491b4c83b1e322aad1abafcd9c01dcc9e56a Mon Sep 17 00:00:00 2001 From: Joseph Pugh Date: Mon, 28 Apr 2014 14:26:37 -0500 Subject: [PATCH] implement RemoteGitBuild::getFileLinkTemplate required by PHPCI/View/Build/view.phtml --- PHPCI/Model/Build/GitlabBuild.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/PHPCI/Model/Build/GitlabBuild.php b/PHPCI/Model/Build/GitlabBuild.php index 98be17c8..8c1e038b 100644 --- a/PHPCI/Model/Build/GitlabBuild.php +++ b/PHPCI/Model/Build/GitlabBuild.php @@ -38,6 +38,18 @@ class GitlabBuild extends RemoteGitBuild return 'http://' . $domain . '/' . $this->getProject()->getReference() . '/tree/' . $this->getBranch(); } + /** + * Get link to specific file (and line) in a the repo's branch + */ + public function getFileLinkTemplate() + { + return sprintf('http://%s/%s/blob/%s/{FILE}#L{LINE}', + $this->getProject()->getAccessInformation("domain"), + $this->getProject()->getReference(), + $this->getBranch() + ); + } + /** * Get the URL to be used to clone this remote repository. */