Merge "Add .pipeline/ with dev image variant"
[lhc/web/wiklou.git] / includes / libs / filebackend / fileop / MoveFileOp.php
index 55dca51..0a83370 100644 (file)
@@ -36,8 +36,10 @@ class MoveFileOp extends FileOp {
 
        protected function doPrecheck( array &$predicates ) {
                $status = StatusValue::newGood();
-               // Check if the source file exists
-               if ( !$this->fileExists( $this->params['src'], $predicates ) ) {
+
+               // Check source file existence
+               $srcExists = $this->fileExists( $this->params['src'], $predicates );
+               if ( $srcExists === false ) {
                        if ( $this->getParam( 'ignoreMissingSource' ) ) {
                                $this->doOperation = false; // no-op
                                // Update file existence predicates (cache 404s)
@@ -50,14 +52,12 @@ class MoveFileOp extends FileOp {
 
                                return $status;
                        }
-                       // Check if a file can be placed/changed at the destination
-               } elseif ( !$this->backend->isPathUsableInternal( $this->params['dst'] ) ) {
-                       $status->fatal( 'backend-fail-usable', $this->params['dst'] );
-                       $status->fatal( 'backend-fail-move', $this->params['src'], $this->params['dst'] );
+               } elseif ( $srcExists === FileBackend::EXISTENCE_ERROR ) {
+                       $status->fatal( 'backend-fail-stat', $this->params['src'] );
 
                        return $status;
                }
-               // Check if destination file exists
+               // Check if an incompatible destination file exists
                $status->merge( $this->precheckDestExistence( $predicates ) );
                $this->params['dstExists'] = $this->destExists; // see FileBackendStore::setFileCache()
                if ( $status->isOK() ) {