Template
1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo synced 2024-12-01 06:16:09 +01:00

Added short-hash support to downloads

This commit is contained in:
Bwko 2016-11-23 22:06:56 +01:00
parent b2cce12980
commit ff0d1bd602

View file

@ -311,7 +311,7 @@ func Download(ctx *context.Context) {
ctx.Handle(500, "GetTagCommit", err) ctx.Handle(500, "GetTagCommit", err)
return return
} }
} else if len(refName) == 40 { } else if len(refName) >= 4 && len(refName) <= 40 {
commit, err = gitRepo.GetCommit(refName) commit, err = gitRepo.GetCommit(refName)
if err != nil { if err != nil {
ctx.Handle(404, "GetCommit", nil) ctx.Handle(404, "GetCommit", nil)