diff options
author | Unknown <joe2010xtmf@163.com> | 2014-05-11 12:17:10 -0400 |
---|---|---|
committer | Unknown <joe2010xtmf@163.com> | 2014-05-11 12:17:10 -0400 |
commit | 605a38759fe226b0f2541c72275caf1af234860f (patch) | |
tree | a8cf8e91849cf351eb8fa261183e2e08528ad156 | |
parent | fd4b123e88e8a106dc0f43db9e9d59c877b2d799 (diff) | |
download | gitea-605a38759fe226b0f2541c72275caf1af234860f.tar.gz gitea-605a38759fe226b0f2541c72275caf1af234860f.zip |
Fix #94 and fix #169
-rw-r--r-- | cmd/serve.go | 4 | ||||
-rw-r--r-- | modules/middleware/repo.go | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/cmd/serve.go b/cmd/serve.go index e881717c3e..5eac51f5e4 100644 --- a/cmd/serve.go +++ b/cmd/serve.go @@ -68,7 +68,7 @@ func parseCmd(cmd string) (string, string) { 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 { @@ -128,7 +128,7 @@ func runServ(k *cli.Context) { 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 diff --git a/modules/middleware/repo.go b/modules/middleware/repo.go index 1516482167..ff99f82897 100644 --- a/modules/middleware/repo.go +++ b/modules/middleware/repo.go @@ -153,11 +153,11 @@ func RepoAssignment(redirect bool, args ...bool) martini.Handler { 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 |