Skip to content

Commit

Permalink
git clean before git auto-update (#2036)
Browse files Browse the repository at this point in the history
* git clean before git auto-update

To avoid #2012 in the future

* More generic SQLite file filter

* Another -f

https://git-scm.com/docs/git-clean
  • Loading branch information
Alkarex committed Sep 30, 2018
1 parent eb5e219 commit 83756c6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion app/Controllers/updateController.php
Expand Up @@ -32,7 +32,13 @@ public static function gitPull() {
$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());
}
Expand Down
2 changes: 1 addition & 1 deletion data/users/.gitignore
@@ -1,5 +1,5 @@
*/
*/config.php
*/db.sqlite
*/*.sqlite
!_/
*/log*.txt

0 comments on commit 83756c6

Please sign in to comment.