From ff0d1bd602c725726ce60b5964c62003c75312b9 Mon Sep 17 00:00:00 2001 From: Bwko Date: Wed, 23 Nov 2016 22:06:56 +0100 Subject: [PATCH] Added short-hash support to downloads --- routers/repo/repo.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/routers/repo/repo.go b/routers/repo/repo.go index c3e9faf4995..50564bd4263 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)