projects
/
GITManagedWebpage.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
added possibility to use origin branches
[GITManagedWebpage.git]
/
GITManagedWebpage.class.php
diff --git
a/GITManagedWebpage.class.php
b/GITManagedWebpage.class.php
index 481bf143ecafcfea7fe91ae9ec2bc06cece07a0e..5b15d8cbf32293e6209683935ce3756d0628e306 100644
(file)
--- a/
GITManagedWebpage.class.php
+++ b/
GITManagedWebpage.class.php
@@
-90,7
+90,7
@@
class GITManagedWebpage {
} else
$argstr .= " ".escapeshellarg($arg);
}
} else
$argstr .= " ".escapeshellarg($arg);
}
- $gitcmd = 'git '.escapeshellarg('--git-dir='.$this->workdir.'repository/.git').' '.escapeshellarg('--work-tree='.$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;
}
$output = shell_exec($gitcmd);
return $output;
}
@@
-218,7
+218,7
@@
class GITManagedWebpage {
if($branch == $default_branch)
$dir = $this->localdir;
else
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) {
if(file_exists($dir))
return $dir;
else if($create) {
@@
-290,8
+290,12
@@
class GITManagedWebpage {
if($this->loopedcall)
return;
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)) {
$this->setActiveBranch($branch, $remember);
if(!$this->localBranchPath($branch)) {