8000 fixed #15118 [Filesystem] mirroring a symlink copies absolute file path · symfony/symfony@a83d525 · GitHub
[go: up one dir, main page]

Skip to content

Commit a83d525

Browse files
danepowellfabpot
authored andcommitted
fixed #15118 [Filesystem] mirroring a symlink copies absolute file path
1 parent 2a0f6fb commit a83d525

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/Symfony/Component/Filesystem/Filesystem.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ public function mirror($originDir, $targetDir, \Traversable $iterator = null, $o
402402
}
403403
} else {
404404
if (is_link($file)) {
405-
$this->symlink($file->getRealPath(), $target);
405+
$this->symlink($file->getLinkTarget(), $target);
406406
} elseif (is_dir($file)) {
407407
$this->mkdir($target);
408408
} elseif (is_file($file)) {

src/Symfony/Component/Filesystem/Tests/FilesystemTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -906,7 +906,7 @@ public function testMirrorCopiesRelativeLinkedContents()
906906
$this->assertTrue(is_dir($targetPath));
907907
$this->assertFileEquals($sourcePath.'/nested/file1.txt', $targetPath.DIRECTORY_SEPARATOR.'link1/file1.txt');
908908
$this->assertTrue(is_link($targetPath.DIRECTORY_SEPARATOR.'link1'));
909-
$this->assertEquals($sourcePath.'nested', readlink($targetPath.DIRECTORY_SEPARATOR.'link1'));
909+
$this->assertEquals('nested', readlink($targetPath.DIRECTORY_SEPARATOR.'link1'));
910910
}
911911

912912
/**

0 commit comments

Comments
 (0)
0