mirror of
https://github.com/klaussilveira/gitlist.git
synced 2025-11-18 03:30:55 +01:00
Fixes an issue with stats in paths with whitespace
Splitting on whitespace of the ls-tree output is not enough: when a path contains a space only the first part is taken as the file name. This commit changes that behaviour by using another command to list all the file names.
This commit is contained in:
@@ -344,9 +344,13 @@ class Repository extends BaseRepository
|
||||
if (is_numeric($file[3])) {
|
||||
$data['size'] += $file[3];
|
||||
}
|
||||
}
|
||||
|
||||
if (($pos = strrpos($file[4], '.')) !== false) {
|
||||
$extension = substr($file[4], $pos);
|
||||
$logs = $this->getClient()->run($this, 'ls-tree -l -r --name-only ' . $branch);
|
||||
$files = explode("\n", $logs);
|
||||
foreach ($files as $file) {
|
||||
if (($pos = strrpos($file, '.')) !== false) {
|
||||
$extension = substr($file, $pos);
|
||||
|
||||
if (($pos = strrpos($extension, '/')) === false) {
|
||||
$data['extensions'][] = $extension;
|
||||
|
||||
Reference in New Issue
Block a user