Skip to content

Commit 7e07e4a

Browse files
acrobatNyholm
authored andcommitted
Allow symlink to files to be downloaded (KnpLabs#751)
1 parent 8363f95 commit 7e07e4a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/Github/Api/Repository/Contents.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -276,8 +276,8 @@ public function download($username, $repository, $path, $reference = null)
276276
{
277277
$file = $this->show($username, $repository, $path, $reference);
278278

279-
if (!isset($file['type']) || 'file' !== $file['type']) {
280-
throw new InvalidArgumentException(sprintf('Path "%s" is not a file.', $path));
279+
if (!isset($file['type']) || !in_array($file['type'], ['file', 'symlink'], true)) {
280+
throw new InvalidArgumentException(sprintf('Path "%s" is not a file or a symlink to a file.', $path));
281281
}
282282

283283
if (!isset($file['content'])) {

0 commit comments

Comments
 (0)