|
36 | 36 |
|
37 | 37 | $mainline = 'mainline_' . (string)rand(0, 9999);
|
38 | 38 | $repo = getRepo($options, $mainline);
|
39 |
| -$branches = $repo->getBranches(); |
| 39 | +$branches = $repo->getBranches('--remotes'); |
40 | 40 | generateBranchesList($options['output-file'], $branches, $options['branch']);
|
41 | 41 | $changes = retrieveChangesAcrossForks($mainline, $repo, $options['branch']);
|
42 | 42 | $changedFiles = getChangedFiles($changes, $fileExtensions);
|
@@ -73,7 +73,7 @@ function generateBranchesList($outputFile, $branches, $branchName)
|
73 | 73 | $branchesList = fopen($branchOutputFile, 'w');
|
74 | 74 | fwrite($branchesList, $branchName . PHP_EOL);
|
75 | 75 | foreach ($branches as $branch) {
|
76 |
| - fwrite($branchesList, substr(strrchr($branch, '/'),1) . PHP_EOL); |
| 76 | + fwrite($branchesList, substr(strrchr($branch, '/'), 1) . PHP_EOL); |
77 | 77 | }
|
78 | 78 | fclose($branchesList);
|
79 | 79 | }
|
@@ -105,7 +105,7 @@ function getChangedFiles(array $changes, array $fileExtensions)
|
105 | 105 | *
|
106 | 106 | * @param array $options
|
107 | 107 | * @param string $mainline
|
108 |
| - * @return array |
| 108 | + * @return GitRepo |
109 | 109 | * @throws Exception
|
110 | 110 | */
|
111 | 111 | function getRepo($options, $mainline)
|
@@ -227,11 +227,12 @@ public function fetch($remoteAlias)
|
227 | 227 | /**
|
228 | 228 | * Returns branches
|
229 | 229 | *
|
230 |
| - * @return array |
| 230 | + * @param string $source |
| 231 | + * @return array|mixed |
231 | 232 | */
|
232 |
| - public function getBranches() |
| 233 | + public function getBranches($source = '--all') |
233 | 234 | {
|
234 |
| - $result = $this->call(sprintf('branch -r')); |
| 235 | + $result = $this->call(sprintf('branch ' . $source)); |
235 | 236 |
|
236 | 237 | return is_array($result) ? $result : [];
|
237 | 238 | }
|
|
0 commit comments