diff --git a/src/IDF/Plugin/SyncGit.php b/src/IDF/Plugin/SyncGit.php index 41134f4..77bc06f 100644 --- a/src/IDF/Plugin/SyncGit.php +++ b/src/IDF/Plugin/SyncGit.php @@ -65,10 +65,8 @@ class IDF_Plugin_SyncGit */ static public function postUpdate($signal, &$params) { - // Find the corresponding project. - $git_dir = substr($params['git_dir'], 0, -4); // Chop the ".git" - $elts = preg_split('#/#', $git_dir, -1, PREG_SPLIT_NO_EMPTY); - $pname = array_pop($elts); + // Chop the ".git" and get what is left + $pname = basename(substr($params['git_dir'], 0, -4)); try { $project = IDF_Project::getOr404($pname); } catch (Pluf_HTTP_Error404 $e) { diff --git a/src/IDF/Plugin/SyncSvn.php b/src/IDF/Plugin/SyncSvn.php index 1080fa5..bfebf51 100644 --- a/src/IDF/Plugin/SyncSvn.php +++ b/src/IDF/Plugin/SyncSvn.php @@ -242,9 +242,7 @@ class IDF_Plugin_SyncSvn */ public function processSvnUpdateTimeline($params) { - $repo_dir = $params['repo_dir']; - $elts = preg_split('#/#', $repo_dir, -1, PREG_SPLIT_NO_EMPTY); - $pname = array_pop($elts); + $pname = basename($params['repo_dir']); try { $project = IDF_Project::getOr404($pname); } catch (Pluf_HTTP_Error404 $e) {