summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBwko <bouwko@gmail.com>2016-11-23 22:06:56 +0100
committerBwko <bouwko@gmail.com>2016-11-24 11:45:16 +0100
commitff0d1bd602c725726ce60b5964c62003c75312b9 (patch)
treec5f6f4197cb3a78a8de7a86cf86877bb5152db15
parentb2cce12980f6f86cf5f68e70af4588add6cc2452 (diff)
downloadgitea-ff0d1bd602c725726ce60b5964c62003c75312b9.tar.gz
gitea-ff0d1bd602c725726ce60b5964c62003c75312b9.zip
Added short-hash support to downloads
-rw-r--r--routers/repo/repo.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/routers/repo/repo.go b/routers/repo/repo.go
index c3e9faf499..50564bd426 100644
--- a/routers/repo/repo.go
+++ b/routers/repo/repo.go
@@ -311,7 +311,7 @@ func Download(ctx *context.Context) {
ctx.Handle(500, "GetTagCommit", err)
return
}
- } else if len(refName) == 40 {
+ } else if len(refName) >= 4 && len(refName) <= 40 {
commit, err = gitRepo.GetCommit(refName)
if err != nil {
ctx.Handle(404, "GetCommit", nil)