diff options
author | ᴜɴᴋɴᴡᴏɴ <u@gogs.io> | 2020-03-09 02:08:53 +0800 |
---|---|---|
committer | ᴜɴᴋɴᴡᴏɴ <u@gogs.io> | 2020-03-09 02:08:53 +0800 |
commit | e87f1107ca74c267ec0ef07054085b7a7871eb77 (patch) | |
tree | 95c7a8aaddbabcc16f74f8d8b3a15ee5e1c7b527 /internal/route/repo | |
parent | bebaf4c1122d641affbeaead2b77807072bc51a7 (diff) |
commit: fix unexpected truncation in title
The commit message should not be treated as locale at all.
Diffstat (limited to 'internal/route/repo')
-rw-r--r-- | internal/route/repo/commit.go | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/internal/route/repo/commit.go b/internal/route/repo/commit.go index e7fa5778..7b11e89a 100644 --- a/internal/route/repo/commit.go +++ b/internal/route/repo/commit.go @@ -119,7 +119,6 @@ func Diff(c *context.Context) { commit, err := c.Repo.GitRepo.CatFileCommit(commitID) if err != nil { - // TODO: Move checker to gitutil package c.NotFoundOrServerError("get commit by ID", gitutil.IsErrRevisionNotExist, err) return } @@ -135,11 +134,11 @@ func Diff(c *context.Context) { parents := make([]string, commit.ParentsCount()) for i := 0; i < commit.ParentsCount(); i++ { sha, err := commit.ParentID(i) - parents[i] = sha.String() if err != nil { c.NotFound() return } + parents[i] = sha.String() } setEditorconfigIfExists(c) @@ -147,7 +146,7 @@ func Diff(c *context.Context) { return } - c.Title(commit.Summary() + " · " + tool.ShortSHA1(commitID)) + c.RawTitle(commit.Summary() + " · " + tool.ShortSHA1(commitID)) c.Data["CommitID"] = commitID c.Data["IsSplitStyle"] = c.Query("style") == "split" c.Data["Username"] = userName |