From: pk910 Date: Sun, 6 Oct 2013 01:23:44 +0000 (+0200) Subject: added possibility to use origin branches X-Git-Url: http://git.pk910.de/?p=GITManagedWebpage.git;a=commitdiff_plain;h=33287094dd6fb43d7329c0f06507db63afbbc35b added possibility to use origin branches --- diff --git a/GITManagedWebpage.class.php b/GITManagedWebpage.class.php index 3a76edc..5b15d8c 100644 --- a/GITManagedWebpage.class.php +++ b/GITManagedWebpage.class.php @@ -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) { @@ -290,8 +290,12 @@ class GITManagedWebpage { if($this->loopedcall) return; - if(!$this->branchExists($branch)) - return false; + if(!$this->branchExists($branch)) { + if($this->branchExists('origin/'.$branch)) + $branch = 'origin/'.$branch; + else + return false; + } $this->setActiveBranch($branch, $remember); if(!$this->localBranchPath($branch)) {