@@ -67,7 +67,7 @@ export async function getCommits(from, to, execaOptions) {
6767 * @throws {Error } If the `git` command fails.
6868 */
6969export async function getBranches ( repositoryUrl , execaOptions ) {
70- return ( await execa ( "git" , [ "ls-remote" , "--heads" , repositoryUrl ] , execaOptions ) ) . stdout
70+ return ( await execa ( "git" , [ "ls-remote" , "--heads" , "--" , repositoryUrl ] , execaOptions ) ) . stdout
7171 . split ( "\n" )
7272 . filter ( Boolean )
7373 . map ( ( branch ) => branch . match ( / ^ .+ r e f s \/ h e a d s \/ (?< branch > .+ ) $ / ) [ 1 ] ) ;
@@ -115,8 +115,8 @@ export async function fetch(repositoryUrl, branch, ciBranch, execaOptions) {
115115 "--unshallow" ,
116116 "--tags" ,
117117 ...( branch === ciBranch && ! isDetachedHead
118- ? [ repositoryUrl ]
119- : [ "--update-head-ok" , repositoryUrl , `+refs/heads/${ branch } :refs/heads/${ branch } ` ] ) ,
118+ ? [ "--" , repositoryUrl ]
119+ : [ "--update-head-ok" , "--" , repositoryUrl , `+refs/heads/${ branch } :refs/heads/${ branch } ` ] ) ,
120120 ] ,
121121 execaOptions
122122 ) ;
@@ -127,8 +127,8 @@ export async function fetch(repositoryUrl, branch, ciBranch, execaOptions) {
127127 "fetch" ,
128128 "--tags" ,
129129 ...( branch === ciBranch && ! isDetachedHead
130- ? [ repositoryUrl ]
131- : [ "--update-head-ok" , repositoryUrl , `+refs/heads/${ branch } :refs/heads/${ branch } ` ] ) ,
130+ ? [ "--" , repositoryUrl ]
131+ : [ "--update-head-ok" , "--" , repositoryUrl , `+refs/heads/${ branch } :refs/heads/${ branch } ` ] ) ,
132132 ] ,
133133 execaOptions
134134 ) ;
@@ -143,9 +143,9 @@ export async function fetch(repositoryUrl, branch, ciBranch, execaOptions) {
143143 */
144144export async function fetchNotes ( repositoryUrl , execaOptions ) {
145145 try {
146- await execa ( "git" , [ "fetch" , "--unshallow" , repositoryUrl , `+refs/notes/*:refs/notes/*` ] , execaOptions ) ;
146+ await execa ( "git" , [ "fetch" , "--unshallow" , "--" , repositoryUrl , `+refs/notes/*:refs/notes/*` ] , execaOptions ) ;
147147 } catch {
148- await execa ( "git" , [ "fetch" , repositoryUrl , `+refs/notes/*:refs/notes/*` ] , {
148+ await execa ( "git" , [ "fetch" , "--" , repositoryUrl , `+refs/notes/*:refs/notes/*` ] , {
149149 ...execaOptions ,
150150 reject : false ,
151151 } ) ;
@@ -204,7 +204,7 @@ export async function isGitRepo(execaOptions) {
204204 */
205205export async function verifyAuth ( repositoryUrl , branch , execaOptions ) {
206206 try {
207- await execa ( "git" , [ "push" , "--dry-run" , "--no-verify" , repositoryUrl , `HEAD:${ branch } ` ] , execaOptions ) ;
207+ await execa ( "git" , [ "push" , "--dry-run" , "--no-verify" , "--" , repositoryUrl , `HEAD:${ branch } ` ] , execaOptions ) ;
208208 } catch ( error ) {
209209 debug ( error ) ;
210210 throw error ;
@@ -233,7 +233,7 @@ export async function tag(tagName, ref, execaOptions) {
233233 * @throws {Error } if the push failed.
234234 */
235235export async function push ( repositoryUrl , execaOptions ) {
236- await execa ( "git" , [ "push" , "--tags" , repositoryUrl ] , execaOptions ) ;
236+ await execa ( "git" , [ "push" , "--tags" , "--" , repositoryUrl ] , execaOptions ) ;
237237}
238238
239239/**
@@ -245,7 +245,7 @@ export async function push(repositoryUrl, execaOptions) {
245245 * @throws {Error } if the push failed.
246246 */
247247export async function pushNotes ( repositoryUrl , ref , execaOptions ) {
248- await execa ( "git" , [ "push" , repositoryUrl , `refs/notes/${ GIT_NOTE_REF } -${ ref } ` ] , execaOptions ) ;
248+ await execa ( "git" , [ "push" , "--" , repositoryUrl , `refs/notes/${ GIT_NOTE_REF } -${ ref } ` ] , execaOptions ) ;
249249}
250250
251251/**
@@ -292,7 +292,9 @@ export async function verifyBranchName(branch, execaOptions) {
292292export async function isBranchUpToDate ( repositoryUrl , branch , execaOptions ) {
293293 return (
294294 ( await getGitHead ( execaOptions ) ) ===
295- ( await execa ( "git" , [ "ls-remote" , "--heads" , repositoryUrl , branch ] , execaOptions ) ) . stdout . match ( / ^ (?< ref > \w + ) ? / ) [ 1 ]
295+ ( await execa ( "git" , [ "ls-remote" , "--heads" , "--" , repositoryUrl , branch ] , execaOptions ) ) . stdout . match (
296+ / ^ (?< ref > \w + ) ? /
297+ ) [ 1 ]
296298 ) ;
297299}
298300
0 commit comments