Fix overwriting folders on rename with SFTP

This aligns the behavior with other storages and also fixes the failing
unit test testRenameOverWriteDirectory
This commit is contained in:
Vincent Petry 2016-07-01 17:24:57 +02:00 committed by Lukas Reschke
parent b37e1ed17f
commit d372836efc
No known key found for this signature in database
GPG Key ID: B9F6980CF6E759B1
1 changed files with 1 additions and 1 deletions

View File

@ -426,7 +426,7 @@ class SFTP extends \OC\Files\Storage\Common {
*/
public function rename($source, $target) {
try {
if (!$this->is_dir($target) && $this->file_exists($target)) {
if ($this->file_exists($target)) {
$this->unlink($target);
}
return $this->getConnection()->rename(