Skip to content

Commit bef9610

Browse files
codebytereMarshallOfSound
authored andcommitted
chore: account for remotes in branch parsing (electron#18930)
1 parent 81497c7 commit bef9610

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

script/lib/utils.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,19 @@ async function getCurrentBranch (gitDir) {
4040
let branch = await handleGitCall(['rev-parse', '--abbrev-ref', 'HEAD'], gitDir)
4141
if (branch !== 'master' && !branch.match(/[0-9]+-[0-9]+-x/)) {
4242
const lastCommit = await handleGitCall(['rev-parse', 'HEAD'], gitDir)
43-
const branches = (await handleGitCall(['branch', '--contains', lastCommit], gitDir)).split('\n')
43+
const branches = (await handleGitCall([
44+
'branch',
45+
'--contains',
46+
lastCommit,
47+
'--remote'
48+
], gitDir)).split('\n')
49+
4450
branch = branches.filter(b => b === 'master' || b.match(/[0-9]+-[0-9]+-x/))[0]
4551
if (!branch) {
4652
console.log(`${fail} no release branch exists for this ref`)
4753
process.exit(1)
4854
}
55+
if (branch.startsWith('origin/')) branch = branch.substr('origin/'.length)
4956
}
5057
return branch.trim()
5158
}

0 commit comments

Comments
 (0)