From 54e0a6e5535863dc6fc4b1f6f3543bbf905974b1 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Sun, 30 May 2021 12:05:50 +0200 Subject: Fix git update error message (#3645) #fix https://github.com/FreshRSS/FreshRSS/issues/3644 --- app/Controllers/updateController.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'app/Controllers/updateController.php') diff --git a/app/Controllers/updateController.php b/app/Controllers/updateController.php index 8ed2380c5..6f947d0c6 100644 --- a/app/Controllers/updateController.php +++ b/app/Controllers/updateController.php @@ -48,7 +48,7 @@ class FreshRSS_update_Controller extends Minz_ActionController { try { exec('git fetch --prune', $output, $return); if ($return == 0) { - unset($output); + $output = []; exec('git status -sb --porcelain remote', $output, $return); } else { $line = is_array($output) ? implode('; ', $output) : $output; @@ -71,14 +71,15 @@ class FreshRSS_update_Controller extends Minz_ActionController { try { exec('git fetch --prune', $output, $return); if ($return == 0) { - unset($output); + $output = []; exec('git reset --hard FETCH_HEAD', $output, $return); } + $output = []; self::migrateToGitEdge(); } catch (Exception $e) { Minz_Log::warning('Git error: ' . $e->getMessage()); - if ($output == '') { + if (empty($output)) { $output = $e->getMessage(); } $return = 1; -- cgit v1.2.3