FileLink is generated with commit id for github and bitbucket
fixes #89
This commit is contained in:
parent
1ff7b1cdfe
commit
0ad8c4b327
|
@ -47,18 +47,16 @@ class BitbucketBuild extends RemoteGitBuild
|
|||
public function getFileLinkTemplate()
|
||||
{
|
||||
$reference = $this->getProject()->getReference();
|
||||
$branch = $this->getBranch();
|
||||
|
||||
if ($this->getExtra('build_type') == 'pull_request') {
|
||||
$matches = [];
|
||||
preg_match('/[\/:]([a-zA-Z0-9_\-]+\/[a-zA-Z0-9_\-]+)/', $this->getExtra('remote_url'), $matches);
|
||||
|
||||
$reference = $matches[1];
|
||||
$branch = $this->getExtra('remote_branch');
|
||||
}
|
||||
|
||||
$link = 'https://bitbucket.org/' . $reference . '/';
|
||||
$link .= 'src/' . $branch . '/';
|
||||
$link .= 'src/' . $this->getCommitId() . '/';
|
||||
$link .= '{FILE}';
|
||||
$link .= '#{BASEFILE}-{LINE}';
|
||||
|
||||
|
|
|
@ -47,18 +47,16 @@ class BitbucketHgBuild extends MercurialBuild
|
|||
public function getFileLinkTemplate()
|
||||
{
|
||||
$reference = $this->getProject()->getReference();
|
||||
$branch = $this->getBranch();
|
||||
|
||||
if ($this->getExtra('build_type') == 'pull_request') {
|
||||
$matches = [];
|
||||
preg_match('/[\/:]([a-zA-Z0-9_\-]+\/[a-zA-Z0-9_\-]+)/', $this->getExtra('remote_url'), $matches);
|
||||
|
||||
$reference = $matches[1];
|
||||
$branch = $this->getExtra('remote_branch');
|
||||
}
|
||||
|
||||
$link = 'https://bitbucket.org/' . $reference . '/';
|
||||
$link .= 'src/' . $branch . '/';
|
||||
$link .= 'src/' . $this->getCommitId() . '/';
|
||||
$link .= '{FILE}';
|
||||
$link .= '#{BASEFILE}-{LINE}';
|
||||
|
||||
|
|
|
@ -138,18 +138,16 @@ class GithubBuild extends RemoteGitBuild
|
|||
public function getFileLinkTemplate()
|
||||
{
|
||||
$reference = $this->getProject()->getReference();
|
||||
$branch = $this->getBranch();
|
||||
|
||||
if ($this->getExtra('build_type') == 'pull_request') {
|
||||
$matches = [];
|
||||
preg_match('/[\/:]([a-zA-Z0-9_\-]+\/[a-zA-Z0-9_\-]+)/', $this->getExtra('remote_url'), $matches);
|
||||
|
||||
$reference = $matches[1];
|
||||
$branch = $this->getExtra('remote_branch');
|
||||
}
|
||||
|
||||
$link = 'https://github.com/' . $reference . '/';
|
||||
$link .= 'blob/' . $branch . '/';
|
||||
$link .= 'blob/' . $this->getCommitId() . '/';
|
||||
$link .= '{FILE}';
|
||||
$link .= '#L{LINE}-L{LINE_END}';
|
||||
|
||||
|
|
Loading…
Reference in a new issue