Skip to content
Snippets Groups Projects
Commit c4149a49 authored by Axel Hahn's avatar Axel Hahn
Browse files

- fix: checkout tags with git version 1.7

parent 55c001c8
No related branches found
No related tags found
No related merge requests found
...@@ -444,12 +444,20 @@ class vcs implements iVcs { ...@@ -444,12 +444,20 @@ class vcs implements iVcs {
$sBranchname = str_replace("origin/", "", $this->_sCurrentBranch); $sBranchname = str_replace("origin/", "", $this->_sCurrentBranch);
$sGitCmd = 'export GIT_SSH="' . $this->_sWrapper . '" ; export PKEY="' . $this->_sKeyfile . '" ; '; $sGitCmd = 'export GIT_SSH="' . $this->_sWrapper . '" ; export PKEY="' . $this->_sKeyfile . '" ; ';
$sGitCmd .= 'echo git clone --depth 1 --recursive --branch "' . $sBranchname . '" "' . $this->getUrl() . '" "' . $sWorkDir . '" ; ';
$sGitCmd .= 'git clone --depth 1 --recursive --branch "' . $sBranchname . '" "' . $this->getUrl() . '" "' . $sWorkDir . '" 2>&1; '; // this does not checkout tags in git v1.7 - only branches:
// $sGitCmd .= 'echo git clone --depth 1 --recursive --branch "' . $sBranchname . '" "' . $this->getUrl() . '" "' . $sWorkDir . '" ; ';
// $sGitCmd .= ' git clone --depth 1 --recursive --branch "' . $sBranchname . '" "' . $this->getUrl() . '" "' . $sWorkDir . '" 2>&1; ';
//
$sGitCmd .= 'echo git clone "' . $this->getUrl() . '" "'.$sWorkDir.'" 2>&1 \&\& cd "'.$sWorkDir.'" \&\& git checkout "' . $sBranchname . '" ; ';
$sGitCmd .= ' git clone "' . $this->getUrl() . '" "'.$sWorkDir.'" 2>&1 && cd "'.$sWorkDir.'" && git checkout 2>&1 ';
$this->log(__FUNCTION__." start command $sGitCmd"); $this->log(__FUNCTION__." start command $sGitCmd");
$sReturn = shell_exec($sGitCmd); // $sReturn = shell_exec($sGitCmd);
exec($sGitCmd, $sReturn, $iRc);
echo print_r($sReturn, 1) . "<br>rc=$rc<br>";
$this->log(__FUNCTION__." end command $sGitCmd"); $this->log(__FUNCTION__." end command $sGitCmd");
return $sReturn; return implode("\n", $sReturn). "\nrc=$iRc";
} }
/** /**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment