diff options
author | Unknwon <u@gogs.io> | 2017-04-06 17:13:53 -0400 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2017-04-06 17:13:53 -0400 |
commit | 0e271799f2ec744332761cd87fe0d96f4d9653e0 (patch) | |
tree | a49a9609b8b37e972a60b505b2e3900922e55497 /routers/repo | |
parent | 3c0de1713367ffecfe4606ad0553a550f568e74d (diff) |
Refactoring: rename and simplify pkg/tool functions
Diffstat (limited to 'routers/repo')
-rw-r--r-- | routers/repo/commit.go | 4 | ||||
-rw-r--r-- | routers/repo/http.go | 2 | ||||
-rw-r--r-- | routers/repo/pull.go | 2 | ||||
-rw-r--r-- | routers/repo/repo.go | 2 |
4 files changed, 5 insertions, 5 deletions
diff --git a/routers/repo/commit.go b/routers/repo/commit.go index 19803dc6..9723b7f1 100644 --- a/routers/repo/commit.go +++ b/routers/repo/commit.go @@ -165,7 +165,7 @@ func Diff(ctx *context.Context) { ctx.Data["Username"] = userName ctx.Data["Reponame"] = repoName ctx.Data["IsImageFile"] = commit.IsImageFile - ctx.Data["Title"] = commit.Summary() + " · " + tool.ShortSha(commitID) + ctx.Data["Title"] = commit.Summary() + " · " + tool.ShortSHA1(commitID) ctx.Data["Commit"] = commit ctx.Data["Author"] = models.ValidateCommitWithEmail(commit) ctx.Data["Diff"] = diff @@ -228,7 +228,7 @@ func CompareDiff(ctx *context.Context) { ctx.Data["Username"] = userName ctx.Data["Reponame"] = repoName ctx.Data["IsImageFile"] = commit.IsImageFile - ctx.Data["Title"] = "Comparing " + tool.ShortSha(beforeCommitID) + "..." + tool.ShortSha(afterCommitID) + " · " + userName + "/" + repoName + ctx.Data["Title"] = "Comparing " + tool.ShortSHA1(beforeCommitID) + "..." + tool.ShortSHA1(afterCommitID) + " · " + userName + "/" + repoName ctx.Data["Commit"] = commit ctx.Data["Diff"] = diff ctx.Data["DiffNotAvailable"] = diff.NumFiles() == 0 diff --git a/routers/repo/http.go b/routers/repo/http.go index 256ca16f..786fa542 100644 --- a/routers/repo/http.go +++ b/routers/repo/http.go @@ -232,7 +232,7 @@ func ComposeHookEnvs(opts ComposeHookEnvsOptions) []string { ENV_AUTH_USER_NAME + "=" + opts.AuthUser.Name, ENV_AUTH_USER_EMAIL + "=" + opts.AuthUser.Email, ENV_REPO_OWNER_NAME + "=" + opts.OwnerName, - ENV_REPO_OWNER_SALT_MD5 + "=" + tool.EncodeMD5(opts.OwnerSalt), + ENV_REPO_OWNER_SALT_MD5 + "=" + tool.MD5(opts.OwnerSalt), ENV_REPO_ID + "=" + com.ToStr(opts.RepoID), ENV_REPO_NAME + "=" + opts.RepoName, ENV_REPO_CUSTOM_HOOKS_PATH + "=" + path.Join(opts.RepoPath, "custom_hooks"), diff --git a/routers/repo/pull.go b/routers/repo/pull.go index 6d420121..6ff313b7 100644 --- a/routers/repo/pull.go +++ b/routers/repo/pull.go @@ -738,7 +738,7 @@ func TriggerTask(ctx *context.Context) { if ctx.Written() { return } - if secret != tool.EncodeMD5(owner.Salt) { + if secret != tool.MD5(owner.Salt) { ctx.Error(404) log.Trace("TriggerTask [%s/%s]: invalid secret", owner.Name, repo.Name) return diff --git a/routers/repo/repo.go b/routers/repo/repo.go index 2781da9a..bdc471fe 100644 --- a/routers/repo/repo.go +++ b/routers/repo/repo.go @@ -323,7 +323,7 @@ func Download(ctx *context.Context) { return } - archivePath = path.Join(archivePath, tool.ShortSha(commit.ID.String())+ext) + archivePath = path.Join(archivePath, tool.ShortSHA1(commit.ID.String())+ext) if !com.IsFile(archivePath) { if err := commit.CreateArchive(archivePath, archiveType); err != nil { ctx.Handle(500, "Download -> CreateArchive "+archivePath, err) |