From 7eafe3213f456bb4fcbaeea5562ab60c4ef6cf87 Mon Sep 17 00:00:00 2001 From: Thibault Meyer <0xbaadf00d@users.noreply.github.com> Date: Fri, 12 Aug 2016 00:34:00 +0200 Subject: Fix #3321: commit tag shortener (#3418) * Fix #3321: commit tag shortener * Check short commit * remove debug * Edit unit tests * Show 10-char short SHA --- cmd/web.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'cmd') diff --git a/cmd/web.go b/cmd/web.go index bcb99a0e..eb364cfe 100644 --- a/cmd/web.go +++ b/cmd/web.go @@ -534,12 +534,12 @@ func runWeb(ctx *cli.Context) error { m.Get("/src/*", repo.Home) m.Get("/raw/*", repo.SingleDownload) m.Get("/commits/*", repo.RefCommits) - m.Get("/commit/:sha([a-z0-9]{40})$", repo.Diff) + m.Get("/commit/:sha([a-z0-9]{7,40})$", repo.Diff) m.Get("/forks", repo.Forks) }, context.RepoRef()) - m.Get("/commit/:sha([a-z0-9]{40})\\.:ext(patch|diff)", repo.RawDiff) + m.Get("/commit/:sha([a-z0-9]{7,40})\\.:ext(patch|diff)", repo.RawDiff) - m.Get("/compare/:before([a-z0-9]{40})\\.\\.\\.:after([a-z0-9]{40})", repo.CompareDiff) + m.Get("/compare/:before([a-z0-9]{7,40})\\.\\.\\.:after([a-z0-9]{7,40})", repo.CompareDiff) }, ignSignIn, context.RepoAssignment(), repo.MustBeNotBare) m.Group("/:username/:reponame", func() { m.Get("/stars", repo.Stars) -- cgit v1.2.3