From a5d08dce937e8c859bfa2e091d2c2eabf35f0cae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Mudr=C3=A1k?= Date: Thu, 25 Sep 2014 21:17:53 +0200 Subject: [PATCH] MDL-47411 admin: Check if the plugin is a git submodule on uninstalling Credit goes to PJ King. I was trying to add unit tests for this new behaviour but it turned out there are many hard-coded dependencies and it's not easy to make the whole machinery support alternative location of testable (fake) plugins. --- lib/classes/plugin_manager.php | 4 ++++ lib/classes/update/deployer.php | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/lib/classes/plugin_manager.php b/lib/classes/plugin_manager.php index 69a706ae060..b385127ad59 100644 --- a/lib/classes/plugin_manager.php +++ b/lib/classes/plugin_manager.php @@ -654,6 +654,10 @@ class core_plugin_manager { return 'git'; } + if (is_file($pluginroot.'/.git')) { + return 'git-submodule'; + } + if (is_dir($pluginroot.'/CVS')) { return 'cvs'; } diff --git a/lib/classes/update/deployer.php b/lib/classes/update/deployer.php index d25560920e4..25ba1683081 100644 --- a/lib/classes/update/deployer.php +++ b/lib/classes/update/deployer.php @@ -181,6 +181,10 @@ class deployer { return 'git'; } + if (is_file($pluginroot.'/.git')) { + return 'git-submodule'; + } + if (is_dir($pluginroot.'/CVS')) { return 'cvs'; }