summaryrefslogtreecommitdiffstats
path: root/modules/middleware/repo.go
diff options
context:
space:
mode:
authorUnknwon <joe2010xtmf@163.com>2014-09-24 17:43:33 -0400
committerUnknwon <joe2010xtmf@163.com>2014-09-24 17:43:33 -0400
commit25268577a53bd326b21866c792d7ec390a6e4d94 (patch)
tree457fbb28905efe99389e4db5bcfb413ca05f4d4d /modules/middleware/repo.go
parent612fdb98df0ff84c81603a5c8d66a5f2f4395bd5 (diff)
downloadgitea-25268577a53bd326b21866c792d7ec390a6e4d94.tar.gz
gitea-25268577a53bd326b21866c792d7ec390a6e4d94.zip
Fix download archive issue
Diffstat (limited to 'modules/middleware/repo.go')
-rw-r--r--modules/middleware/repo.go11
1 files changed, 3 insertions, 8 deletions
diff --git a/modules/middleware/repo.go b/modules/middleware/repo.go
index e447ee3a4d..c0290b2e8f 100644
--- a/modules/middleware/repo.go
+++ b/modules/middleware/repo.go
@@ -200,7 +200,7 @@ func RepoAssignment(redirect bool, args ...bool) macaron.Handler {
ctx.Repo.Commit, err = gitRepo.GetCommitOfBranch(refName)
if err != nil {
- ctx.Handle(404, "RepoAssignment invalid branch", nil)
+ ctx.Handle(500, "RepoAssignment invalid branch", err)
return
}
ctx.Repo.CommitId = ctx.Repo.Commit.Id.String()
@@ -209,14 +209,9 @@ func RepoAssignment(redirect bool, args ...bool) macaron.Handler {
ctx.Repo.IsTag = true
ctx.Repo.BranchName = refName
- ctx.Repo.Tag, err = gitRepo.GetTag(refName)
+ ctx.Repo.Commit, err = gitRepo.GetCommitOfTag(refName)
if err != nil {
- ctx.Handle(404, "RepoAssignment invalid tag", nil)
- return
- }
- ctx.Repo.Commit, err = ctx.Repo.Tag.Commit()
- if err != nil {
- ctx.Handle(500, "RepoAssignment", fmt.Errorf("fail to get tag commit(%s): %v", refName, err))
+ ctx.Handle(500, "RepoAssignment invalid tag", err)
return
}
ctx.Repo.CommitId = ctx.Repo.Commit.Id.String()