ci: correctly rebase PRs for branches contain a slash (/) (#40184)
Previously, due to a bug in `rebase-pr.js`, PRs for branches containing a slash (/) in their name would fail to be rebased ([example failure][1]). This commit ensures that such branch names are handled correctly. [1]: https://circleci.com/gh/angular/angular/884503 PR Close #40184
This commit is contained in:
parent
10a468aab9
commit
5831d2b685
@ -92,7 +92,7 @@ async function _main() {
|
|||||||
* likely correct branch will be the first one encountered in the list.
|
* likely correct branch will be the first one encountered in the list.
|
||||||
*/
|
*/
|
||||||
function getRefFromBranchList(gitOutput) {
|
function getRefFromBranchList(gitOutput) {
|
||||||
const branches = gitOutput.split('\n').map(b => b.split('/').slice(1).join('').trim());
|
const branches = gitOutput.split('\n').map(b => b.split('/').slice(1).join('/').trim());
|
||||||
return branches.sort((a, b) => {
|
return branches.sort((a, b) => {
|
||||||
if (a === 'master') {
|
if (a === 'master') {
|
||||||
return -1;
|
return -1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user