@@ -200,7 +200,7 @@ func (g *GitGetter) clone(ctx context.Context, dst, sshKeyFile string, u *url.UR
200200 args = append (args , "--depth" , strconv .Itoa (depth ))
201201 args = append (args , "--branch" , ref )
202202 }
203- args = append (args , u .String (), dst )
203+ args = append (args , "--" , u .String (), dst )
204204
205205 cmd := exec .CommandContext (ctx , "git" , args ... )
206206 setupGitEnv (cmd , sshKeyFile )
@@ -289,7 +289,7 @@ func findDefaultBranch(ctx context.Context, dst string) string {
289289// default branch. "master" is returned if no HEAD symref exists.
290290func findRemoteDefaultBranch (ctx context.Context , u * url.URL ) string {
291291 var stdoutbuf bytes.Buffer
292- cmd := exec .CommandContext (ctx , "git" , "ls-remote" , "--symref" , u .String (), "HEAD" )
292+ cmd := exec .CommandContext (ctx , "git" , "ls-remote" , "--symref" , "--" , u .String (), "HEAD" )
293293 cmd .Stdout = & stdoutbuf
294294 err := cmd .Run ()
295295 matches := lsRemoteSymRefRegexp .FindStringSubmatch (stdoutbuf .String ())
0 commit comments