args = ss[1]
verb = fmt.Sprintf("%s %s", verb, ss[0])
}
- return verb, args
+ return verb, strings.Replace(args, "'/", "'", 1)
}
func In(b string, sl map[string]int) bool {
repoUser, err := models.GetUserByName(repoUserName)
if err != nil {
println("You have no right to access")
- qlog.Fatal("Get user failed", err)
+ qlog.Fatalf("Get user failed: %v", err)
}
// access check
ctx.Data["IsRepositoryOwner"] = ctx.Repo.IsOwner
ctx.Data["BranchName"] = ""
- sshPrefix := ""
if base.SshPort != 22 {
- sshPrefix = "ssh://"
+ ctx.Repo.CloneLink.SSH = fmt.Sprintf("ssh://%s@%s/%s/%s.git", base.RunUser, base.Domain, user.LowerName, repo.LowerName)
+ } else {
+ ctx.Repo.CloneLink.SSH = fmt.Sprintf("%s@%s:%s/%s.git", base.RunUser, base.Domain, user.LowerName, repo.LowerName)
}
- ctx.Repo.CloneLink.SSH = fmt.Sprintf("%s%s@%s:%s/%s.git", sshPrefix, base.RunUser, base.Domain, user.LowerName, repo.LowerName)
ctx.Repo.CloneLink.HTTPS = fmt.Sprintf("%s%s/%s.git", base.AppUrl, user.LowerName, repo.LowerName)
ctx.Data["CloneLink"] = ctx.Repo.CloneLink