aboutsummaryrefslogtreecommitdiffstats
path: root/routers/routes
diff options
context:
space:
mode:
authorAndrzej Ressel <jereksel@gmail.com>2019-04-20 04:47:00 +0200
committertechknowlogick <matti@mdranta.net>2019-04-19 22:47:00 -0400
commit469d9b7d9ac3714a146d8e745618641dbe03fafa (patch)
tree7c29b6eddde19222196702d1c47919e4b4a9394d /routers/routes
parentb9d1fb6de32613ada3869d2a9692cb078ed48534 (diff)
downloadgitea-469d9b7d9ac3714a146d8e745618641dbe03fafa.tar.gz
gitea-469d9b7d9ac3714a146d8e745618641dbe03fafa.zip
Add option to blame files (#5721)
Diffstat (limited to 'routers/routes')
-rw-r--r--routers/routes/routes.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/routers/routes/routes.go b/routers/routes/routes.go
index db42eecf8c..5fa37a8417 100644
--- a/routers/routes/routes.go
+++ b/routers/routes/routes.go
@@ -849,6 +849,12 @@ func RegisterRoutes(m *macaron.Macaron) {
m.Get("/*", context.RepoRefByType(context.RepoRefLegacy), repo.RefCommits)
}, repo.MustBeNotEmpty, reqRepoCodeReader)
+ m.Group("/blame", func() {
+ m.Get("/branch/*", context.RepoRefByType(context.RepoRefBranch), repo.RefBlame)
+ m.Get("/tag/*", context.RepoRefByType(context.RepoRefTag), repo.RefBlame)
+ m.Get("/commit/*", context.RepoRefByType(context.RepoRefCommit), repo.RefBlame)
+ }, repo.MustBeNotEmpty, reqRepoCodeReader)
+
m.Group("", func() {
m.Get("/graph", repo.Graph)
m.Get("/commit/:sha([a-f0-9]{7,40})$", repo.SetEditorconfigIfExists, repo.SetDiffViewStyle, repo.Diff)