Skip to content

Commit

Permalink
fixed #15118 [Filesystem] mirroring a symlink copies absolute file path
Browse files Browse the repository at this point in the history
  • Loading branch information
danepowell authored and fabpot committed Oct 6, 2015
1 parent 1c4d1b9 commit 3159d90
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Filesystem.php
Expand Up @@ -402,7 +402,7 @@ public function mirror($originDir, $targetDir, \Traversable $iterator = null, $o
}
} else {
if (is_link($file)) {
$this->symlink($file->getRealPath(), $target);
$this->symlink($file->getLinkTarget(), $target);
} elseif (is_dir($file)) {
$this->mkdir($target);
} elseif (is_file($file)) {
Expand Down
2 changes: 1 addition & 1 deletion Tests/FilesystemTest.php
Expand Up @@ -906,7 +906,7 @@ public function testMirrorCopiesRelativeLinkedContents()
$this->assertTrue(is_dir($targetPath));
$this->assertFileEquals($sourcePath.'/nested/file1.txt', $targetPath.DIRECTORY_SEPARATOR.'link1/file1.txt');
$this->assertTrue(is_link($targetPath.DIRECTORY_SEPARATOR.'link1'));
$this->assertEquals($sourcePath.'nested', readlink($targetPath.DIRECTORY_SEPARATOR.'link1'));
$this->assertEquals('nested', readlink($targetPath.DIRECTORY_SEPARATOR.'link1'));
}

/**
Expand Down

0 comments on commit 3159d90

Please sign in to comment.