(c *context.Context)
| 79 | } |
| 80 | |
| 81 | func SearchCommits(c *context.Context) { |
| 82 | c.Data["PageIsCommits"] = true |
| 83 | |
| 84 | keyword := c.Query("q") |
| 85 | if keyword == "" { |
| 86 | c.Redirect(c.Repo.RepoLink + "/commits/" + c.Repo.BranchName) |
| 87 | return |
| 88 | } |
| 89 | |
| 90 | commits, err := c.Repo.Commit.SearchCommits(keyword) |
| 91 | if err != nil { |
| 92 | c.Error(err, "search commits") |
| 93 | return |
| 94 | } |
| 95 | |
| 96 | commits = RenderIssueLinks(commits, c.Repo.RepoLink) |
| 97 | c.Data["Commits"] = matchUsersWithCommitEmails(c.Req.Context(), commits) |
| 98 | |
| 99 | c.Data["Keyword"] = keyword |
| 100 | c.Data["Username"] = c.Repo.Owner.Name |
| 101 | c.Data["Reponame"] = c.Repo.Repository.Name |
| 102 | c.Data["Branch"] = c.Repo.BranchName |
| 103 | c.Success(COMMITS) |
| 104 | } |
| 105 | |
| 106 | func FileHistory(c *context.Context) { |
| 107 | renderCommits(c, c.Repo.TreePath) |
no test coverage detected