fix(Git Command): add space chars (\s) support (github #53)

github #53
This commit is contained in:
cubic
2022-03-11 16:00:42 +08:00
parent 66d9a21f92
commit 20d25b6237
2 changed files with 6 additions and 3 deletions

View File

@@ -42,8 +42,8 @@ class Command
// return '"' . $argument . '"';
$pattern = [
'/(^|[^\\\\])((\\\\\\\\)*[\'\"\$\|])/',
'/(^|[^\\\\])((\\\\\\\\)*\\\\([^\'\"\|\$\\\\]|$))/'
'/(^|[^\\\\])((\\\\\\\\)*[\s\'\"\$\|])/',
'/(^|[^\\\\])((\\\\\\\\)*\\\\([^\s\'\"\|\$\\\\]|$))/'
];
$replacement = [
'$1\\\\$2',

View File

@@ -1413,7 +1413,7 @@ class Repository_model extends CI_Model
return FALSE;
}
$revision = Command::wrapArgument($revision);
$revision = Command::wrapArgument($revision);
$filepath = Command::wrapArgument($filepath);
// create target repository workspace
@@ -1465,6 +1465,9 @@ class Repository_model extends CI_Model
return FALSE;
}
$branch = Command::wrapArgument($branch);
$filePath = Command::wrapArgument($filePath);
$command = GitCommand::getLastLog($branch, $filePath, $lastSha);
if (!$command) {
return FALSE;