Fixed to have a simpler code.
This commit is contained in:
parent
45fa309c07
commit
10f08386f7
@ -65,10 +65,8 @@ class IDF_Plugin_SyncGit
|
|||||||
*/
|
*/
|
||||||
static public function postUpdate($signal, &$params)
|
static public function postUpdate($signal, &$params)
|
||||||
{
|
{
|
||||||
// Find the corresponding project.
|
// Chop the ".git" and get what is left
|
||||||
$git_dir = substr($params['git_dir'], 0, -4); // Chop the ".git"
|
$pname = basename(substr($params['git_dir'], 0, -4));
|
||||||
$elts = preg_split('#/#', $git_dir, -1, PREG_SPLIT_NO_EMPTY);
|
|
||||||
$pname = array_pop($elts);
|
|
||||||
try {
|
try {
|
||||||
$project = IDF_Project::getOr404($pname);
|
$project = IDF_Project::getOr404($pname);
|
||||||
} catch (Pluf_HTTP_Error404 $e) {
|
} catch (Pluf_HTTP_Error404 $e) {
|
||||||
|
@ -242,9 +242,7 @@ class IDF_Plugin_SyncSvn
|
|||||||
*/
|
*/
|
||||||
public function processSvnUpdateTimeline($params)
|
public function processSvnUpdateTimeline($params)
|
||||||
{
|
{
|
||||||
$repo_dir = $params['repo_dir'];
|
$pname = basename($params['repo_dir']);
|
||||||
$elts = preg_split('#/#', $repo_dir, -1, PREG_SPLIT_NO_EMPTY);
|
|
||||||
$pname = array_pop($elts);
|
|
||||||
try {
|
try {
|
||||||
$project = IDF_Project::getOr404($pname);
|
$project = IDF_Project::getOr404($pname);
|
||||||
} catch (Pluf_HTTP_Error404 $e) {
|
} catch (Pluf_HTTP_Error404 $e) {
|
||||||
|
Loading…
Reference in New Issue
Block a user