Skip to content

Commit 3e236a9

Browse files
Fixes #978: Do not call ignorelist on the archive if it is empty. (#979)
1 parent 3df1c25 commit 3e236a9

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/Task/Archive/Pack.php

+9-4
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,9 @@ protected function archiveTar($archiveFile, $items)
206206
}
207207

208208
$tar_object = new \Archive_Tar($archiveFile);
209-
$tar_object->setIgnoreList($this->ignoreList);
209+
if (!empty($this->ignoreList)) {
210+
$tar_object->setIgnoreList($this->ignoreList);
211+
}
210212
foreach ($items as $placementLocation => $filesystemLocation) {
211213
$p_remove_dir = $filesystemLocation;
212214
$p_add_dir = $placementLocation;
@@ -259,9 +261,12 @@ protected function addItemsToZip($zip, $items)
259261
foreach ($items as $placementLocation => $filesystemLocation) {
260262
if (is_dir($filesystemLocation)) {
261263
$finder = new Finder();
262-
// Add slashes so Symfony Finder patterns work like Archive_Tar ones.
263-
$zipIgnoreList = preg_filter('/^|$/', '/', $this->ignoreList);
264-
$finder->files()->in($filesystemLocation)->ignoreDotFiles(false)->notName($zipIgnoreList)->notPath($zipIgnoreList);
264+
$finder->files()->in($filesystemLocation)->ignoreDotFiles(false);
265+
if (!empty($this->ignoreList)) {
266+
// Add slashes so Symfony Finder patterns work like Archive_Tar ones.
267+
$zipIgnoreList = preg_filter('/^|$/', '/', $this->ignoreList);
268+
$finder->notName($zipIgnoreList)->notPath($zipIgnoreList);
269+
}
265270

266271
foreach ($finder as $file) {
267272
// Replace Windows slashes or resulting zip will have issues on *nixes.

0 commit comments

Comments
 (0)