X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=src%2Fpharext%2FSourceDir%2FGit.php;h=8e35bf9b3f50fb292501f6c02652f090397685e8;hb=861260c111bff72f60665393660b6f5375559510;hp=a16b1e67769726e26c912b7d9883edcd2635dca9;hpb=26683702fdc53d2431ae2bc5081439ac12685d1b;p=pharext%2Fpharext diff --git a/src/pharext/SourceDir/Git.php b/src/pharext/SourceDir/Git.php index a16b1e6..8e35bf9 100644 --- a/src/pharext/SourceDir/Git.php +++ b/src/pharext/SourceDir/Git.php @@ -46,16 +46,18 @@ class Git implements \IteratorAggregate, SourceDir private function generateFiles() { $pwd = getcwd(); chdir($this->path); - if (($pipe = popen("git ls-files", "r"))) { + if (($pipe = popen("git ls-tree -r --name-only HEAD", "r"))) { + $path = realpath($this->path); while (!feof($pipe)) { if (strlen($file = trim(fgets($pipe)))) { if ($this->cmd->getArgs()->verbose) { $this->cmd->info("Packaging %s\n", $file); } - if (!($realpath = realpath($file))) { - $this->cmd->error("File %s does not exist\n", $file); + /* there may be symlinks, so no realpath here */ + if (!file_exists("$path/$file")) { + $this->cmd->warn("File %s does not exist in %s\n", $file, $path); } - yield $realpath; + yield "$path/$file"; } } pclose($pipe);