mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
bug fixed for message tag
This commit is contained in:
@@ -56,8 +56,10 @@ type Context struct {
|
||||
Repository *models.Repository
|
||||
Owner *models.User
|
||||
Commit *git.Commit
|
||||
Tag *git.Tag
|
||||
GitRepo *git.Repository
|
||||
BranchName string
|
||||
TagName string
|
||||
CommitId string
|
||||
RepoLink string
|
||||
CloneLink struct {
|
||||
|
@@ -185,16 +185,16 @@ func RepoAssignment(redirect bool, args ...bool) martini.Handler {
|
||||
ctx.Repo.CommitId = ctx.Repo.Commit.Id.String()
|
||||
|
||||
} else if gitRepo.IsTagExist(refName) {
|
||||
ctx.Repo.IsBranch = true
|
||||
ctx.Repo.IsTag = true
|
||||
ctx.Repo.BranchName = refName
|
||||
|
||||
ctx.Repo.Commit, err = gitRepo.GetCommitOfTag(refName)
|
||||
ctx.Repo.Tag, err = gitRepo.GetTag(refName)
|
||||
if err != nil {
|
||||
ctx.Handle(404, "RepoAssignment invalid tag", nil)
|
||||
return
|
||||
}
|
||||
ctx.Repo.Commit, _ = ctx.Repo.Tag.Commit()
|
||||
ctx.Repo.CommitId = ctx.Repo.Commit.Id.String()
|
||||
|
||||
} else if len(refName) == 40 {
|
||||
ctx.Repo.IsCommit = true
|
||||
ctx.Repo.CommitId = refName
|
||||
@@ -244,6 +244,7 @@ func RepoAssignment(redirect bool, args ...bool) martini.Handler {
|
||||
}
|
||||
|
||||
ctx.Data["BranchName"] = ctx.Repo.BranchName
|
||||
ctx.Data["TagName"] = ctx.Repo.TagName
|
||||
brs, err := ctx.Repo.GitRepo.GetBranches()
|
||||
if err != nil {
|
||||
log.Error("RepoAssignment(GetBranches): %v", err)
|
||||
|
Reference in New Issue
Block a user