Fix cloning for src.suse.de instance #22
Reference in New Issue
Block a user
Delete Branch "adrianSuSE/autogits:main"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@@ -57,8 +57,9 @@ func failOnError(err error, msg string) {func fetchPrGit(git common.Git, pr *models.PullRequest) error {// clone PR head and base and return pathcloneURL, nil := common.TranslateHttpsToSshUrl(pr.Head.Repo.CloneURL)add a flag parameter "--use-ssh-clone" (could be global) and then add condition here if (UseSSHClone) { }.
so,
cloneURL := pr.Head.Repo.CloneURL
if (UseSSHClone) {
cloneURL = pr.Head.Repo.SSHURL
}
@@ -604,3 +607,3 @@flag.Int64Var(&ProcessIDOnly, "id", -1, "Process only the specific ID and ignore the rest. Use for debugging")flag.StringVar(&BuildRoot, "build-root", "", "Default build location for staging projects. Default is bot's home project")giteaHost := flag.String("gitea", "src.opensuse.org", "Gitea instance")flag.StringVar(&giteaHost, "gitea", "src.opensuse.org", "Gitea instance")add a flag parameter "use-ssh-clone" here
Then you also don't need to expose giteaHost as global
a908020482tob7625cd4c4