No longer fail to remove a non-existing post-update hook on repository

creation (fixes issue 752)
This commit is contained in:
Gert van Valkenhoef 2011-10-31 23:19:57 +01:00 committed by Thomas Keller
parent b0ac05b608
commit 8397d86313
2 changed files with 7 additions and 4 deletions

View File

@ -53,6 +53,8 @@ or newer to properly run this version of Indefero!
- Source links without a specific revision did not work due to a wrong regex - Source links without a specific revision did not work due to a wrong regex
(issue 730) (issue 730)
- Avatar URL generation use correctly the configuration (issue 732) - Avatar URL generation use correctly the configuration (issue 732)
- The SyncGit plugin no longer fails to remove a non-existing post-update hook
on repository creation (issue 752)
- The error detection and reporting in the SyncMonotone plugin has been improved - The error detection and reporting in the SyncMonotone plugin has been improved
- The branch links users of the Subversion frontend get when they enter a wrong - The branch links users of the Subversion frontend get when they enter a wrong
revision are fixed; this list is now also only displayed (for any SCM) if revision are fixed; this list is now also only displayed (for any SCM) if

View File

@ -210,22 +210,23 @@ class IDF_Plugin_SyncGit_Serve
// Indefero's one. // Indefero's one.
$p = realpath(dirname(__FILE__).'/../../../../scripts/git-post-update'); $p = realpath(dirname(__FILE__).'/../../../../scripts/git-post-update');
$p = Pluf::f('idf_plugin_syncgit_post_update', $p); $p = Pluf::f('idf_plugin_syncgit_post_update', $p);
if (!@unlink($fullpath.'/hooks/post-update')) { $post_update_hook = $fullpath.'/hooks/post-update';
if (file_exists($post_update_hook) && !@unlink($post_update_hook)) {
Pluf_Log::warn(array('IDF_Plugin_Git_Serve::initRepository', Pluf_Log::warn(array('IDF_Plugin_Git_Serve::initRepository',
'post-update hook removal error.', 'post-update hook removal error.',
$fullpath.'/hooks/post-update')); $post_update_hook));
return; return;
} }
$out = array(); $out = array();
$res = 0; $res = 0;
exec(sprintf(Pluf::f('idf_exec_cmd_prefix', '').'ln -s %s %s', exec(sprintf(Pluf::f('idf_exec_cmd_prefix', '').'ln -s %s %s',
escapeshellarg($p), escapeshellarg($p),
escapeshellarg($fullpath.'/hooks/post-update')), escapeshellarg($post_update_hook)),
$out, $res); $out, $res);
if ($res != 0) { if ($res != 0) {
Pluf_Log::warn(array('IDF_Plugin_Git_Serve::initRepository', Pluf_Log::warn(array('IDF_Plugin_Git_Serve::initRepository',
'post-update hook creation error.', 'post-update hook creation error.',
$fullpath.'/hooks/post-update')); $post_update_hook));
return; return;
} }
Pluf_Log::debug(array('IDF_Plugin_Git_Serve::initRepository', Pluf_Log::debug(array('IDF_Plugin_Git_Serve::initRepository',