* change for ajax save log for svn and git.

This commit is contained in:
wangyidong
2016-12-06 10:39:19 +08:00
parent 2f679cee93
commit e10309b1d0
3 changed files with 18 additions and 6 deletions
+8 -4
View File
@@ -121,17 +121,21 @@ class git extends control
$message = trim($this->post->message);
$revision = trim($this->post->revision);
$files = $this->post->files;
/* Ignore git. */
if(strpos($repoUrl, '://') === false) die();
if(empty($repoUrl)) die();
$parsedFiles = array();
foreach($files as $file)
{
$file = trim($file);
if(empty($file)) continue;
$action = '';
if(preg_match('/^[\w][ \t]/', $file))
{
$action = $file[0];
$file = trim(substr($file, 2));
}
$path = str_replace($repoRoot, '', $file);
$parsedFiles[''][] = $path;
$parsedFiles[$action][] = ltrim($path, '/');
}
$objects = $this->git->parseComment($message);