set auth-in-url flag to true when using ssh clone (#4488)

Co-authored-by: Kashif Khan <[email protected]>
This commit is contained in:
Shahzad Haider
2025-10-08 17:41:34 +05:00
committed by GitHub
co-authored by Kashif Khan
parent 26d039c1a9
commit d005847359
+2 -2
View File
@@ -602,11 +602,11 @@ func CloneRepoUsingUnauthenticated(ctx context.Context, url, clonePath string, a
// CloneRepoUsingSSH clones a repo using SSH.
func CloneRepoUsingSSH(ctx context.Context, gitURL string, args ...string) (string, *git.Repository, error) {
if isCodeCommitURL(gitURL) {
return CloneRepo(ctx, nil, gitURL, "", false, args...)
return CloneRepo(ctx, nil, gitURL, "", true, args...)
}
userInfo := url.User("git")
return CloneRepo(ctx, userInfo, gitURL, "", false, args...)
return CloneRepo(ctx, userInfo, gitURL, "", true, args...)
}
var codeCommitRE = regexp.MustCompile(`ssh://git-codecommit\.[\w-]+\.amazonaws\.com`)