Skip to content
Snippets Groups Projects
Commit 20c5dece authored by hahn's avatar hahn
Browse files

update git::getRevision

parent 521bbe50
Branches
No related tags found
1 merge request!195534 add docker
...@@ -120,7 +120,9 @@ class vcs implements iVcs { ...@@ -120,7 +120,9 @@ class vcs implements iVcs {
$sGitCmd.='git remote add origin "' . $this->getUrl() . '" 2>&1 '; $sGitCmd.='git remote add origin "' . $this->getUrl() . '" 2>&1 ';
// $sGitCmd='time ('.$sGitCmd.')'; // $sGitCmd='time ('.$sGitCmd.')';
// exec($sGitCmd, $aOutput, $iRc); // exec($sGitCmd, $aOutput, $iRc);
exec($sGitCmd); $this->log(__FUNCTION__." start command <code>$sGitCmd</code>");
exec($sGitCmd, $aOutput,$iRc);
$this->log(__FUNCTION__." command ended with rc=$iRc ". '<pre>'.implode("\n", $aOutput).'</pre>', ($iRc==0 ? 'info':'error'));
} }
return $this->_sTempDir; return $this->_sTempDir;
} }
...@@ -408,6 +410,14 @@ class vcs implements iVcs { ...@@ -408,6 +410,14 @@ class vcs implements iVcs {
} }
$sGitCmd = 'export GIT_SSH="' . $this->_sWrapper . '" ; export PKEY="' . $this->_sKeyfile . '" ; '; $sGitCmd = 'export GIT_SSH="' . $this->_sWrapper . '" ; export PKEY="' . $this->_sKeyfile . '" ; ';
// Luki:
// git clone -b <branch_or_tag> --single-branch <repo_url> --depth 1 --bare <dir>
/*
$sWorkDir=$sWorkDir ? $sWorkDir : $this->_sTempDir;
$sWorkDir='/dev/shm/abc';
$sGitCmd.='git clone -b '.$this->_sCurrentBranch.' --single-branch '.$this->getUrl().' --depth 1 --bare "' . $sWorkDir . '" 2>&1; rm -rf "' . $sWorkDir . '"';
*/
if ($sWorkDir) { if ($sWorkDir) {
$sGitCmd.='cd "' . $sWorkDir . '" && '; $sGitCmd.='cd "' . $sWorkDir . '" && ';
} else { } else {
...@@ -422,7 +432,7 @@ class vcs implements iVcs { ...@@ -422,7 +432,7 @@ class vcs implements iVcs {
// TODO: git 1.9 does needs only the line with --tags // TODO: git 1.9 does needs only the line with --tags
$sGitCmd.=' ( ' $sGitCmd.=' ( '
. 'git fetch --update-head-ok --tags --depth 1 2>&1 ; ' // 1.5 s . 'git fetch --update-head-ok --tags --depth 1 2>&1 ; ' // 1.5 s
. 'git fetch --update-head-ok --depth 1 2>&1 ' // 1.5 s //. 'git fetch --update-head-ok --depth 1 2>&1 ' // 1.5 s
. ') && '; . ') && ';
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment