]> source.dussan.org Git - gitea.git/commitdiff
Added short-hash support to downloads 228/head
authorBwko <bouwko@gmail.com>
Wed, 23 Nov 2016 21:06:56 +0000 (22:06 +0100)
committerBwko <bouwko@gmail.com>
Thu, 24 Nov 2016 10:45:16 +0000 (11:45 +0100)
routers/repo/repo.go

index c3e9faf4995f4b94964d0031c4ed7baccc1f53d5..50564bd426373a2ee68073d625d494a153d9013a 100644 (file)
@@ -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)