diff --git a/lib/scm/gitlab.class.php b/lib/scm/gitlab.class.php
index 94800d5bf2..6bee5ad0cf 100644
--- a/lib/scm/gitlab.class.php
+++ b/lib/scm/gitlab.class.php
@@ -257,6 +257,7 @@ class gitlab
$param = new stdclass;
$param->ref = ($revision and $revision != 'HEAD') ? $revision : $this->branch;
$results = $this->fetch($api, $param);
+ if(isset($results->message)) return array();
$blames = array();
$revLine = 0;
diff --git a/lib/scm/subversion.class.php b/lib/scm/subversion.class.php
index 9ea925bd22..b8ebfe26fe 100644
--- a/lib/scm/subversion.class.php
+++ b/lib/scm/subversion.class.php
@@ -322,7 +322,7 @@ class Subversion
{
$blame = array();
$blame['line'] = (int)$line['line-number'];
- $blame['content'] = $content[$blame['line'] - 1];
+ $blame['content'] = zget($content, $blame['line'] - 1, '');
$blames[$blame['line']] = $blame;
$blames[$revLine]['lines'] ++;
diff --git a/module/gitlab/control.php b/module/gitlab/control.php
index 279d7db0a6..4cfc011203 100644
--- a/module/gitlab/control.php
+++ b/module/gitlab/control.php
@@ -234,7 +234,7 @@ class gitlab extends control
$gitLab = $this->gitlab->getByID($id);
$changes = common::createChanges($oldGitLab, $gitLab);
- $this->action->logHistory($actionID, $changes);
+ $this->loadModel('action')->logHistory($actionID, $changes);
echo js::reload('parent');
}
diff --git a/module/repo/css/ajaxgeteditorcontent.css b/module/repo/css/ajaxgeteditorcontent.css
index 5c5656e3d1..6f06f5e4f0 100644
--- a/module/repo/css/ajaxgeteditorcontent.css
+++ b/module/repo/css/ajaxgeteditorcontent.css
@@ -13,6 +13,7 @@
#relationTabs .tab-nav-item .icon {line-height: inherit;}
#relationTabs > .tabs-navbar {overflow: hidden; padding-bottom: 10px; position: relative; height: 35px;}
#relationTabs > .tabs-navbar > .nav-tabs {position: absolute; display: flex;}
+#relationTabs .tab-nav-link .title {max-width: 300px; display: inline-block; white-space: nowrap; width: 100%; overflow: hidden; text-overflow: ellipsis; padding: 0 5px;}
#related .content, #related .btn {background-color: #F4F5F7; border: none;}
#related .nav-tabs > li.active > a:before {background: none; height: 0;}
#related .table-empty-tip {padding: 35px 10px;}
diff --git a/module/repo/js/monaco.js b/module/repo/js/monaco.js
index 8857a112e5..227a815f81 100644
--- a/module/repo/js/monaco.js
+++ b/module/repo/js/monaco.js
@@ -69,14 +69,21 @@ $(function()
$('#tab-nav-item-' + tab.id).attr('title', decodeURIComponent(filepath));
});
- var link = createLink('repo', 'ajaxGetBranchesAndTags', 'repoID=' + repoID + '&oldRevision=' + branchID);
- $.get(link, function(data)
+ if(['Git', 'Gitlab', 'Gogs', 'Gitea'].indexOf(repo.SCM) != -1)
{
- var result = $.parseJSON(data);
- $('#branchList').empty();
- $('#branchList').append(result.sourceHtml);
- $('#branchList #branchesAndTags').tree({initialState: 'expand'});
- });
+ var link = createLink('repo', 'ajaxGetBranchesAndTags', 'repoID=' + repoID + '&oldRevision=' + branchID);
+ $.get(link, function(data)
+ {
+ var result = $.parseJSON(data);
+ $('#branchList').empty();
+ $('#branchList').append(result.sourceHtml);
+ $('#branchList #branchesAndTags').tree({initialState: 'expand'});
+ });
+ }
+ else
+ {
+ $('#sourceSwapper').hide();
+ }
/**
* Refresh files tree.
diff --git a/module/repo/model.php b/module/repo/model.php
index 9fa9cc3340..7619c87258 100644
--- a/module/repo/model.php
+++ b/module/repo/model.php
@@ -935,7 +935,7 @@ class repoModel extends model
$file->repo = $repoID;
$this->dao->insert(TABLE_REPOFILES)->data($file)->exec();
- if($file->oldPath)
+ if($file->oldPath and $file->action == 'R')
{
$file->path = $file->oldPath;
$file->parent = dirname($file->path);
@@ -2439,7 +2439,7 @@ class repoModel extends model
}
else
{
- $html .= " " . html::a('#filePath' . $file['key'], $file['name'], '', "class='repoFileName' data-path='{$file['path']}'") . '';
+ $html .= " " . html::a('#filePath' . $file['key'], $file['name'], '', "class='repoFileName' data-path='{$file['path']}' title='{$file['path']}'") . '';
}
$html .= '';
}
@@ -2508,7 +2508,7 @@ class repoModel extends model
}
else
{
- $html .= " " . html::a('#filePath' . $childNode['key'], $childNode['name'], '', "class='repoFileName' data-path='{$childNode['path']}'") . '';
+ $html .= " " . html::a('#filePath' . $childNode['key'], $childNode['name'], '', "class='repoFileName' data-path='{$childNode['path']}' title='{$childNode['path']}'") . '';
}
$html .= '';
}
diff --git a/module/repo/view/ajaxgeteditorcontent.html.php b/module/repo/view/ajaxgeteditorcontent.html.php
index 13347f56d9..19390a3b15 100644
--- a/module/repo/view/ajaxgeteditorcontent.html.php
+++ b/module/repo/view/ajaxgeteditorcontent.html.php
@@ -162,8 +162,7 @@ function setTab(titleObj)
{
return {
id: titleObj.type + '-' + titleObj.id,
- title: ' ' + titleObj.title,
- icon: titleObj.type == 'story' ? 'icon-lightbulb' : (titleObj.type == 'task' ? 'icon-check-sign' : 'icon-bug'),
+ title: titleObj.title,
icon: titleObj.type == 'story' ? 'icon-lightbulb text-primary' : (titleObj.type == 'task' ? 'icon-check-sign text-info' : 'icon-bug text-red'),
type: 'iframe',
url: createLink('repo', 'ajaxGetRelationInfo', 'objectID=' + titleObj.id + '&objectType=' + titleObj.type)
@@ -257,6 +256,8 @@ $(function()
$('#relationTabs').on('onOpen', function(event, tab)
{
+ $('#tab-nav-item-' + tab.id).attr('title', tab.title);
+
var objectInfo = tab.id.split('-');
objectID = objectInfo[0];
objectType = objectInfo[1];
diff --git a/module/repo/view/monaco.html.php b/module/repo/view/monaco.html.php
index bbd47622b9..d6eb689fa3 100644
--- a/module/repo/view/monaco.html.php
+++ b/module/repo/view/monaco.html.php
@@ -14,6 +14,7 @@ js::import($jsRoot . '/zui/tabs/tabs.min.js');
js::import($jsRoot . 'misc/base64.js');
js::set('entry', $entry);
js::set('repoID', $repoID);
+js::set('repo', $repo);
js::set('revision', $revision);
js::set('branchID', $branchID);
js::set('file', $pathInfo);