From b8f8447653956fb53e5dee3e3f599dc0289e3335 Mon Sep 17 00:00:00 2001 From: liyuchun Date: Tue, 22 Feb 2022 09:14:59 +0800 Subject: [PATCH] * Fix error. --- lib/scm/gitlab.class.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/scm/gitlab.class.php b/lib/scm/gitlab.class.php index e77660a88b..564a0a4416 100644 --- a/lib/scm/gitlab.class.php +++ b/lib/scm/gitlab.class.php @@ -240,11 +240,11 @@ class gitlab { if(!scm::checkRevision($revision)) return array(); - $path = ltrim($path, DIRECTORY_SEPARATOR); - $path = urlencode($path); - $api = "files/$path/blame"; + $path = ltrim($path, DIRECTORY_SEPARATOR); + $path = urlencode($path); + $api = "files/$path/blame"; $param = new stdclass; - $param->ref = $this->branch; + $param->ref = ($revision and $revision != 'HEAD') ? $revision : $this->branch; $results = $this->fetch($api, $param); $blames = array();