* fix bug for git.

This commit is contained in:
wangyidong
2016-12-06 14:54:19 +08:00
parent 21eba69df9
commit e2c7e649a4
2 changed files with 3 additions and 2 deletions
+1
View File
@@ -122,6 +122,7 @@ class git extends control
$revision = trim($this->post->revision);
$files = $this->post->files;
if(empty($repoUrl)) die();
$repoUrl = rtrim($repoUrl, '/') . '/';
$parsedFiles = array();
foreach($files as $file)
+2 -2
View File
@@ -427,7 +427,7 @@ class gitModel extends model
chdir($repo->path);
$subPath = substr($path, strlen($repo->path) + 1);
$subPath = ltrim('/', $subPath);
$subPath = ltrim($subPath, '/');
exec("$this->client rev-list -n 2 $revision -- $subPath", $lists);
if(count($lists) == 2) list($nowRevision, $preRevision) = $lists;
$cmd = "$this->client diff $preRevision $nowRevision -- $subPath";
@@ -458,7 +458,7 @@ class gitModel extends model
$path = str_replace('%5C', '\\', $path);
$subPath = substr($path, strlen($repo->path) + 1);
$subPath = ltrim('/', $subPath);
$subPath = ltrim($subPath, '/');
chdir($repo->path);
$cmd = "$this->client show $revision:$subPath";
$code = `$cmd`;