From 795fc483cf6510656c4ef17260b2394913b791ce Mon Sep 17 00:00:00 2001
From: "Hahn Axel (hahn)" <axel.hahn@unibe.ch>
Date: Fri, 1 Mar 2024 16:53:30 +0100
Subject: [PATCH] get remote - check string not a regex

---
 public_html/deployment/classes/vcs.git.class.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/public_html/deployment/classes/vcs.git.class.php b/public_html/deployment/classes/vcs.git.class.php
index 93fd235d..46eb67fd 100644
--- a/public_html/deployment/classes/vcs.git.class.php
+++ b/public_html/deployment/classes/vcs.git.class.php
@@ -271,7 +271,7 @@ class vcs implements iVcs {
                 // if a subdir .git exists:
                 // Verify if git remote -v contains the current git url
                 // If not, we delete it
-                $sPreCmd='cd "' . $sWorkdir . '" 2>&1 && git remote -v 2>&1 | grep "' . $sGitUrl . '" >/dev/null || ( echo "DELETING .git dir..."; rm -rf .git && rc=$?; echo "rc=$rc"; sleep 1; exit $rc) ';
+                $sPreCmd='cd "' . $sWorkdir . '" 2>&1 && git remote -v 2>&1 | grep -F "' . $sGitUrl . '" >/dev/null || ( echo "DELETING .git dir..."; rm -rf .git && rc=$?; echo "rc=$rc"; sleep 1; exit $rc) ';
                 $this->log(__FUNCTION__." - start PRE command <code>$sPreCmd</code>");
                 exec($sPreCmd, $aPreLines, $iRc);
                 if (!$iRc==0){
-- 
GitLab