Skip to content

Commit e0e8d52

Browse files
committed
feat: add dedicated test cases to ensure copy and move methods to always overwrite target
1 parent 13f22ea commit e0e8d52

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

LocalFilesystemAdapter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ public function copy(string $source, string $destination, Config $config): void
271271
$this->resolveDirectoryVisibility($config->get(Config::OPTION_DIRECTORY_VISIBILITY))
272272
);
273273

274-
if ( ! @copy($sourcePath, $destinationPath)) {
274+
if ($sourcePath !== $destinationPath && ! @copy($sourcePath, $destinationPath)) {
275275
throw UnableToCopyFile::because(error_get_last()['message'] ?? 'unknown', $source, $destination);
276276
}
277277

0 commit comments

Comments
 (0)