X-Git-Url: http://git.pk910.de/?p=GITManagedWebpage.git;a=blobdiff_plain;f=GITManagedWebpage.class.php;h=2c429f96ed1a047e76a7f5c0f42739f078984cd9;hp=8ac5d53e40244947f4e7eb28959a6b21531f9879;hb=c3d91f1e989eea95c4cef035490c72c8e2455fef;hpb=de094e3abfffe5564b6d6c739254cccb4bcf70ff diff --git a/GITManagedWebpage.class.php b/GITManagedWebpage.class.php index 8ac5d53..2c429f9 100644 --- a/GITManagedWebpage.class.php +++ b/GITManagedWebpage.class.php @@ -90,7 +90,7 @@ class GITManagedWebpage { } else $argstr .= " ".escapeshellarg($arg); } - $gitcmd = 'git '.escapeshellarg('--git-dir='.$this->workdir.'repository/.git').$argstr; + $gitcmd = 'git '.escapeshellarg('--git-dir='.$this->workdir.'repository/.git').' '.escapeshellarg('--work-tree='.$this->workdir.'repository').$argstr; $output = shell_exec($gitcmd); return $output; } @@ -218,7 +218,7 @@ class GITManagedWebpage { if($branch == $default_branch) $dir = $this->localdir; else - $dir = $this->workdir.'branch_'.$branch.'/'; + $dir = $this->workdir.'branch_'.str_replace(array('/'), array('_'), $branch).'/'; if(file_exists($dir)) return $dir; else if($create) { @@ -241,7 +241,6 @@ class GITManagedWebpage { $deleted_files = array(); if(($current_version = $this->getConfig('version_'.$branch))) { - echo $current_version . " == " . $newest_version; if($current_version == $newest_version) return; else { @@ -291,8 +290,10 @@ class GITManagedWebpage { if($this->loopedcall) return; - if(!$this->branchExists($branch)) - return false; + if(!$this->branchExists($branch)) { + if(!$this->branchExists('origin/'.$branch)) + return false; + } $this->setActiveBranch($branch, $remember); if(!$this->localBranchPath($branch)) {