| Author | Dave Jarvis <email> |
|---|---|
| Date | 2026-02-09 00:24:27 GMT-0800 |
| Commit | ede694c6b513fcca8eaf6f0a824409ea95995992 |
| Parent | 5ce3bf0 |
| } | ||
| - public function eachRepository(callable $callback): void { | ||
| - if (!is_dir($this->path)) return; | ||
| - $repos = []; | ||
| - foreach (glob($this->path . '/*.git') as $path) { | ||
| - if (is_dir($path)) { | ||
| - $name = basename($path, '.git'); | ||
| - $repos[$name] = ['path' => $path, 'name' => urldecode($name), 'safe_name' => $name]; | ||
| - } | ||
| - } | ||
| - uasort($repos, fn($a, $b) => strcasecmp($a['name'], $b['name'])); | ||
| - foreach ($repos as $repo) $callback($repo); | ||
| - } | ||
| - | ||
| public function getMainBranch(): ?array { | ||
| $branches = []; | ||
| $entrySha = bin2hex(substr($data, $null + 1, 20)); | ||
| - // Calculate logic internally to encapsulate File creation | ||
| $isDir = ($mode === '40000' || $mode === '040000'); | ||
| $size = $isDir ? 0 : $this->getObjectSize($entrySha); | ||
| } | ||
| - public function foreach(callable $callback): void { | ||
| + public function eachRepository(callable $callback): void { | ||
| if (!is_dir($this->rootPath)) return; | ||
| require_once 'Page.php'; | ||
| require_once 'Router.php'; | ||
| +require_once 'RepositoryList.php'; | ||
| Config::init(); | ||
| -$repoRoot = new Git(Config::getReposPath()); | ||
| $repositories = []; | ||
| -$repoRoot->eachRepository(function($repo) use (&$repositories) { | ||
| +$list = new RepositoryList(Config::getReposPath()); | ||
| +$list->eachRepository(function($repo) use (&$repositories) { | ||
| $repositories[] = $repo; | ||
| }); |
| Delta | 4 lines added, 17 lines removed, 13-line decrease |
|---|