Fix issue 553 : Git escape too much character in a UTF-8 shell

Add an option to configure the git core.quotepath option
This commit is contained in:
William MARTIN
2011-01-06 14:03:07 +01:00
parent 439f1fefe2
commit d654c95689
2 changed files with 24 additions and 0 deletions

View File

@@ -230,6 +230,24 @@ class IDF_Plugin_SyncGit_Serve
}
Pluf_Log::debug(array('IDF_Plugin_Git_Serve::initRepository',
'Added post-update hook.', $fullpath));
// Configure the core.quotepath option
$quotepath = (Pluf::f('git_core_quotepath', true) == true) ? 'true' : 'false';
$out = array();
$res = 0;
exec(sprintf(Pluf::f('idf_exec_cmd_prefix', '').
Pluf::f('git_path', 'git').' config -f %s/config --add core.quotepath %s',
escapeshellarg($fullpath),
escapeshellarg($quotepath)
),
$out, $res);
if ($res != 0) {
Pluf_Log::warn(array('IDF_Plugin_Git_Serve::initRepository',
'core.quotepath configuration error.',
$quotepath));
return;
}
Pluf_Log::debug(array('IDF_Plugin_Git_Serve::initRepository',
'core.quotepath configured.', $quotepath));
}
/**