aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/app/Controllers/updateController.php
diff options
context:
space:
mode:
authorAlexandre Alapetite <alexandre@alapetite.fr>2018-09-30 18:04:49 +0200
committerGitHub <noreply@github.com>2018-09-30 18:04:49 +0200
commit83756c657fbfaeb39f51e412521bd5c80df63a19 (patch)
treec48c18e67dceea702fc7f15a07fdd97540ff6582 /app/Controllers/updateController.php
parenteb5e21944d1bb33e139bc2e76eebf9de89d8361d (diff)
downloadfreshrss-83756c657fbfaeb39f51e412521bd5c80df63a19.tar.gz
freshrss-83756c657fbfaeb39f51e412521bd5c80df63a19.zip
git clean before git auto-update (#2036)
* git clean before git auto-update To avoid https://github.com/FreshRSS/FreshRSS/issues/2012 in the future * More generic SQLite file filter * Another -f https://git-scm.com/docs/git-clean
Diffstat (limited to 'app/Controllers/updateController.php')
-rw-r--r--app/Controllers/updateController.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/app/Controllers/updateController.php b/app/Controllers/updateController.php
index c67b358bb..2be644c85 100644
--- a/app/Controllers/updateController.php
+++ b/app/Controllers/updateController.php
@@ -32,7 +32,13 @@ class FreshRSS_update_Controller extends Minz_ActionController {
$output = array();
$return = 1;
try {
- exec('git pull --ff-only', $output, $return);
+ exec('git clean -f -d -f', $output, $return);
+ if ($return == 0) {
+ exec('git pull --ff-only', $output, $return);
+ } else {
+ $line = is_array($output) ? implode('; ', $output) : '' . $output;
+ Minz_Log::warning('git clean warning:' . $line);
+ }
} catch (Exception $e) {
Minz_Log::warning('git pull error:' . $e->getMessage());
}