mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 16:40:24 +08:00 
			
		
		
		
	Fix #495 and cannot view repository by tag
This commit is contained in:
		@@ -213,7 +213,11 @@ func RepoAssignment(redirect bool, args ...bool) macaron.Handler {
 | 
			
		||||
						ctx.Handle(404, "RepoAssignment invalid tag", nil)
 | 
			
		||||
						return
 | 
			
		||||
					}
 | 
			
		||||
					ctx.Repo.Commit, _ = ctx.Repo.Tag.Commit()
 | 
			
		||||
					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))
 | 
			
		||||
						return
 | 
			
		||||
					}
 | 
			
		||||
					ctx.Repo.CommitId = ctx.Repo.Commit.Id.String()
 | 
			
		||||
				} else if len(refName) == 40 {
 | 
			
		||||
					ctx.Repo.IsCommit = true
 | 
			
		||||
@@ -226,7 +230,7 @@ func RepoAssignment(redirect bool, args ...bool) macaron.Handler {
 | 
			
		||||
						return
 | 
			
		||||
					}
 | 
			
		||||
				} else {
 | 
			
		||||
					ctx.Handle(404, "RepoAssignment invalid repo", errors.New("branch or tag not exist"))
 | 
			
		||||
					ctx.Handle(404, "RepoAssignment invalid repo", fmt.Errorf("branch or tag not exist: %s", refName))
 | 
			
		||||
					return
 | 
			
		||||
				}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user