File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff 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}
You can’t perform that action at this time.
0 commit comments