projects
/
GITManagedWebpage.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
d9b4a6a
)
fixed merging errors
author
pk910
<philipp@zoelle1.de>
Sun, 13 Oct 2013 13:36:31 +0000
(15:36 +0200)
committer
pk910
<philipp@zoelle1.de>
Sun, 13 Oct 2013 13:36:31 +0000
(15:36 +0200)
GITManagedWebpage.class.php
patch
|
blob
|
history
diff --git
a/GITManagedWebpage.class.php
b/GITManagedWebpage.class.php
index fee826c0e284d0d24d0bdabac4961f04140e3d49..c8c7714e719eec80823363657b4263165c185ce7 100644
(file)
--- a/
GITManagedWebpage.class.php
+++ b/
GITManagedWebpage.class.php
@@
-243,9
+243,8
@@
class GITManagedWebpage {
if(substr($path, -1) != '/')
$path .= '/';
$current_branch = str_replace(array("\r", "\n"), array("", ""), $this->gitcmd("rev-parse", "--abbrev-ref", "HEAD"));
if(substr($path, -1) != '/')
$path .= '/';
$current_branch = str_replace(array("\r", "\n"), array("", ""), $this->gitcmd("rev-parse", "--abbrev-ref", "HEAD"));
- if($current_branch != $branch)
- $this->gitcmd("checkout", $branch);
- $this->gitcmd("pull");
+ $this->gitcmd("fetch");
+ $this->gitcmd("reset", "--hard", "origin/".$branch);
$gitret = $this->gitcmd("rev-list", "--max-count=1", $branch);
preg_match("#([a-z0-9]{40})#", $gitret, $match);
$newest_version = $match[1];
$gitret = $this->gitcmd("rev-list", "--max-count=1", $branch);
preg_match("#([a-z0-9]{40})#", $gitret, $match);
$newest_version = $match[1];
@@
-302,6
+301,7
@@
class GITManagedWebpage {
return;
if(!$this->branchExists($branch)) {
return;
if(!$this->branchExists($branch)) {
+ $this->gitcmd("fetch");
if(!$this->branchExists('origin/'.$branch))
return false;
}
if(!$this->branchExists('origin/'.$branch))
return false;
}