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:
parent
439f1fefe2
commit
d654c95689
@ -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));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -255,6 +255,12 @@ $cfg['allowed_scm'] = array('git' => 'IDF_Scm_Git',
|
||||
'mtn' => 'IDF_Scm_Monotone',
|
||||
);
|
||||
|
||||
# Specific git config
|
||||
# The core.quotepath is configured on new repository
|
||||
# True -> All characters upper than 0x80 will be escape (default)
|
||||
# False -> Characters is print directly, enable accented character in a UTF-8 shell
|
||||
# $cfg['git_core_quotepath'] = false;
|
||||
|
||||
# Set to true when uploaded public keys should not only be validated
|
||||
# syntactically, but also by the specific backend. For SSH public
|
||||
# keys, ssh-keygen(3) must be available and usable in PATH, for
|
||||
|
Loading…
Reference in New Issue
Block a user