This repository was archived by the owner on Jan 31, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed
Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -213,6 +213,19 @@ public static function guessCurrentBranchName() : ?string
213213 if (is_numeric ($ major ) && is_numeric ($ minor )) {
214214 $ branch = "$ major. $ minor " ;
215215 }
216+
217+ /* Verify that we use an available branch name. Master has some
218+ version, but no dedicated series. For master, it rather
219+ makes sense to use master as branch name. */
220+ $ git = trim (shell_exec ("where git.exe " ));
221+ if ($ git ) {
222+ $ cmd = "\"$ git \" branch " ;
223+
224+ $ ret = trim (shell_exec ($ cmd ));
225+ if (preg_match_all (",\*\s+master, " , $ ret ) > 0 ) {
226+ $ branch = "master " ;
227+ }
228+ }
216229 }
217230
218231 return $ branch ;
@@ -277,10 +290,10 @@ public static function getCurrentBranchData() : array
277290 }
278291 }
279292
280- if (!$ ret ["stability " ]) {
293+ if (!@ $ ret ["stability " ]) {
281294 throw new Exception ("Failed to find config with stability ' " . self ::getCurrentStabilityName () . "' " );
282295 }
283- if (!$ ret ["crt " ]) {
296+ if (!@ $ ret ["crt " ]) {
284297 throw new Exception ("Failed to find config with arch ' " . self ::getCurrentArchName () . "' " );
285298 }
286299
You can’t perform that action at this time.
0 commit comments