Skip to content

Commit

Permalink
Merge pull request #27973 from owncloud/dont-kill-app-git-clones
Browse files Browse the repository at this point in the history
Don't overwrite a git clone of an app with code from the marketplace
  • Loading branch information
Vincent Petry authored May 22, 2017
2 parents 31b0c41 + 113abf3 commit cb6f4a2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/private/Installer.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
use OC_App;
use OC_DB;
use OC_Helper;
use OCP\App\AppAlreadyInstalledException;

/**
* This class provides the functionality needed to install, update and remove plugins/apps
Expand Down Expand Up @@ -222,6 +223,9 @@ public static function updateApp($info= [], $isShipped=false) {
if($currentDir !== false && is_writable($currentDir)) {
$basedir = $currentDir;
}
if(is_dir("$basedir/.git")) {
throw new AppAlreadyInstalledException("App <{$info['id']}> is a git clone - it will not be updated.");
}
if(is_dir($basedir)) {
OC_Helper::rmdirr($basedir);
}
Expand Down

0 comments on commit cb6f4a2

Please sign in to comment.