From b5c140fa52ddfddb6e33ed3d6b5ce90e821a0587 Mon Sep 17 00:00:00 2001 From: caoyanyi Date: Mon, 28 Nov 2022 13:29:22 +0800 Subject: [PATCH 1/2] * Modify git branh check. --- lib/scm/gitrepo.class.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/scm/gitrepo.class.php b/lib/scm/gitrepo.class.php index 335768ffb5..3a020aacb0 100644 --- a/lib/scm/gitrepo.class.php +++ b/lib/scm/gitrepo.class.php @@ -28,7 +28,9 @@ class GitRepo if($branch) { $branches = $this->branch(); - if(isset($branches[$branch])) $branch = "origin/$branch"; + $cmd = escapeCmd("$this->client branch -r"); + execCmd($cmd . ' 2>&1', 'string', $result); + if(isset($branches[$branch]) and !empty($result)) $branch = "origin/$branch"; } $this->branch = $branch; $this->repo = $repo; From 591f4ab7b1c8fe2e9c01ce01f893b664c9fe4aec Mon Sep 17 00:00:00 2001 From: caoyanyi Date: Mon, 28 Nov 2022 13:30:32 +0800 Subject: [PATCH 2/2] * Adjust code. --- lib/scm/gitrepo.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/scm/gitrepo.class.php b/lib/scm/gitrepo.class.php index 3a020aacb0..718dbd6983 100644 --- a/lib/scm/gitrepo.class.php +++ b/lib/scm/gitrepo.class.php @@ -28,7 +28,7 @@ class GitRepo if($branch) { $branches = $this->branch(); - $cmd = escapeCmd("$this->client branch -r"); + $cmd = escapeCmd("$this->client branch -r"); execCmd($cmd . ' 2>&1', 'string', $result); if(isset($branches[$branch]) and !empty($result)) $branch = "origin/$branch"; }