| Conditions | 2 |
| Paths | 2 |
| Total Lines | 14 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 48 | private static function cloneGitRepository($url, $branch = '') |
||
| 49 | { |
||
| 50 | // Use shallow clone to save time. |
||
| 51 | $args = ['--depth', '1']; |
||
| 52 | |||
| 53 | if (!empty($branch)) { |
||
| 54 | // Clone from specific branch. |
||
| 55 | $args[] = '--branch'; |
||
| 56 | $args[] = $branch; |
||
| 57 | } |
||
| 58 | |||
| 59 | $repository = Admin::cloneRepository(FILES_DIRECTORY_ROOT, $url, $args); |
||
| 60 | return $repository; |
||
| 61 | } |
||
| 62 | } |
||
| 63 |