···5959 Commit *git.Commit
6060 Tag *git.Tag
6161 GitRepo *git.Repository
6262+ RefName string
6263 BranchName string
6364 TagName string
6465 TreePath string
···191192 case r.IsViewBranch:
192193 return "branch/" + util.PathEscapeSegments(r.BranchName)
193194 case r.IsViewTag:
194194- return "tag/" + util.PathEscapeSegments(r.BranchName)
195195+ return "tag/" + util.PathEscapeSegments(r.TagName)
195196 case r.IsViewCommit:
196196- return "commit/" + util.PathEscapeSegments(r.BranchName)
197197+ return "commit/" + util.PathEscapeSegments(r.CommitID)
197198 }
198199 log.Error("Unknown view type for repo: %v", r)
199200 return ""
···563564 ctx.Data["Branches"] = brs
564565 ctx.Data["BranchesCount"] = len(brs)
565566566566- ctx.Data["TagName"] = ctx.Repo.TagName
567567-568567 // If not branch selected, try default one.
569568 // If default branch doesn't exists, fall back to some other branch.
570569 if len(ctx.Repo.BranchName) == 0 {
···573572 } else if len(brs) > 0 {
574573 ctx.Repo.BranchName = brs[0]
575574 }
575575+ ctx.Repo.RefName = ctx.Repo.BranchName
576576 }
577577 ctx.Data["BranchName"] = ctx.Repo.BranchName
578578- ctx.Data["CommitID"] = ctx.Repo.CommitID
579578580579 // People who have push access or have forked repository can propose a new pull request.
581580 canPush := ctx.Repo.CanWrite(unit_model.TypeCode) || (ctx.IsSigned && ctx.User.HasForkedRepo(ctx.Repo.Repository.ID))
···781780 // Get default branch.
782781 if len(ctx.Params("*")) == 0 {
783782 refName = ctx.Repo.Repository.DefaultBranch
784784- ctx.Repo.BranchName = refName
785783 if !ctx.Repo.GitRepo.IsBranchExist(refName) {
786784 brs, _, err := ctx.Repo.GitRepo.GetBranches(0, 0)
787785 if err != nil {
···795793 }
796794 refName = brs[0]
797795 }
796796+ ctx.Repo.RefName = refName
797797+ ctx.Repo.BranchName = refName
798798 ctx.Repo.Commit, err = ctx.Repo.GitRepo.GetBranchCommit(refName)
799799 if err != nil {
800800 ctx.ServerError("GetBranchCommit", err)
···805805806806 } else {
807807 refName = getRefName(ctx, refType)
808808- ctx.Repo.BranchName = refName
808808+ ctx.Repo.RefName = refName
809809 isRenamedBranch, has := ctx.Data["IsRenamedBranch"].(bool)
810810 if isRenamedBranch && has {
811811 renamedBranchName := ctx.Data["RenamedBranchName"].(string)
···817817818818 if refType.RefTypeIncludesBranches() && ctx.Repo.GitRepo.IsBranchExist(refName) {
819819 ctx.Repo.IsViewBranch = true
820820+ ctx.Repo.BranchName = refName
820821821822 ctx.Repo.Commit, err = ctx.Repo.GitRepo.GetBranchCommit(refName)
822823 if err != nil {
···827828828829 } else if refType.RefTypeIncludesTags() && ctx.Repo.GitRepo.IsTagExist(refName) {
829830 ctx.Repo.IsViewTag = true
831831+ ctx.Repo.TagName = refName
832832+830833 ctx.Repo.Commit, err = ctx.Repo.GitRepo.GetTagCommit(refName)
831834 if err != nil {
832835 ctx.ServerError("GetTagCommit", err)
···870873871874 ctx.Data["BranchName"] = ctx.Repo.BranchName
872875 ctx.Data["BranchNameSubURL"] = ctx.Repo.BranchNameSubURL()
876876+ ctx.Data["TagName"] = ctx.Repo.TagName
873877 ctx.Data["CommitID"] = ctx.Repo.CommitID
874878 ctx.Data["TreePath"] = ctx.Repo.TreePath
875879 ctx.Data["IsViewBranch"] = ctx.Repo.IsViewBranch
+1
options/locale/locale_en-US.ini
···971971releases = Releases
972972tag = Tag
973973released_this = released this
974974+file.title = %s at %s
974975file_raw = Raw
975976file_history = History
976977file_view_source = View Source