mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 16:40:24 +08:00 
			
		
		
		
	Remove ref name in PR commits page (#25876)
The branch name display here is based on the repo's default branch which is not correct.  For example, if I changed the default branch, the branch name here will also be changed:   you can confirm this in : https://try.gitea.io/yp05327/testrepo/pulls/1/commits I think we do not need to display branch name here, as we already have the branch info above. 
This commit is contained in:
		@@ -81,7 +81,6 @@ func Commits(ctx *context.Context) {
 | 
				
			|||||||
	ctx.Data["Username"] = ctx.Repo.Owner.Name
 | 
						ctx.Data["Username"] = ctx.Repo.Owner.Name
 | 
				
			||||||
	ctx.Data["Reponame"] = ctx.Repo.Repository.Name
 | 
						ctx.Data["Reponame"] = ctx.Repo.Repository.Name
 | 
				
			||||||
	ctx.Data["CommitCount"] = commitsCount
 | 
						ctx.Data["CommitCount"] = commitsCount
 | 
				
			||||||
	ctx.Data["RefName"] = ctx.Repo.RefName
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	pager := context.NewPagination(int(commitsCount), pageSize, page, 5)
 | 
						pager := context.NewPagination(int(commitsCount), pageSize, page, 5)
 | 
				
			||||||
	pager.SetDefaultParams(ctx)
 | 
						pager.SetDefaultParams(ctx)
 | 
				
			||||||
@@ -157,7 +156,7 @@ func Graph(ctx *context.Context) {
 | 
				
			|||||||
	ctx.Data["Username"] = ctx.Repo.Owner.Name
 | 
						ctx.Data["Username"] = ctx.Repo.Owner.Name
 | 
				
			||||||
	ctx.Data["Reponame"] = ctx.Repo.Repository.Name
 | 
						ctx.Data["Reponame"] = ctx.Repo.Repository.Name
 | 
				
			||||||
	ctx.Data["CommitCount"] = commitsCount
 | 
						ctx.Data["CommitCount"] = commitsCount
 | 
				
			||||||
	ctx.Data["RefName"] = ctx.Repo.RefName
 | 
					
 | 
				
			||||||
	paginator := context.NewPagination(int(graphCommitsCount), setting.UI.GraphMaxCommitNum, page, 5)
 | 
						paginator := context.NewPagination(int(graphCommitsCount), setting.UI.GraphMaxCommitNum, page, 5)
 | 
				
			||||||
	paginator.AddParam(ctx, "mode", "Mode")
 | 
						paginator.AddParam(ctx, "mode", "Mode")
 | 
				
			||||||
	paginator.AddParam(ctx, "hide-pr-refs", "HidePRRefs")
 | 
						paginator.AddParam(ctx, "hide-pr-refs", "HidePRRefs")
 | 
				
			||||||
@@ -203,7 +202,6 @@ func SearchCommits(ctx *context.Context) {
 | 
				
			|||||||
	}
 | 
						}
 | 
				
			||||||
	ctx.Data["Username"] = ctx.Repo.Owner.Name
 | 
						ctx.Data["Username"] = ctx.Repo.Owner.Name
 | 
				
			||||||
	ctx.Data["Reponame"] = ctx.Repo.Repository.Name
 | 
						ctx.Data["Reponame"] = ctx.Repo.Repository.Name
 | 
				
			||||||
	ctx.Data["RefName"] = ctx.Repo.RefName
 | 
					 | 
				
			||||||
	ctx.HTML(http.StatusOK, tplCommits)
 | 
						ctx.HTML(http.StatusOK, tplCommits)
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -247,7 +245,6 @@ func FileHistory(ctx *context.Context) {
 | 
				
			|||||||
	ctx.Data["Reponame"] = ctx.Repo.Repository.Name
 | 
						ctx.Data["Reponame"] = ctx.Repo.Repository.Name
 | 
				
			||||||
	ctx.Data["FileName"] = fileName
 | 
						ctx.Data["FileName"] = fileName
 | 
				
			||||||
	ctx.Data["CommitCount"] = commitsCount
 | 
						ctx.Data["CommitCount"] = commitsCount
 | 
				
			||||||
	ctx.Data["RefName"] = ctx.Repo.RefName
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	pager := context.NewPagination(int(commitsCount), setting.Git.CommitsRangeSize, page, 5)
 | 
						pager := context.NewPagination(int(commitsCount), setting.Git.CommitsRangeSize, page, 5)
 | 
				
			||||||
	pager.SetDefaultParams(ctx)
 | 
						pager.SetDefaultParams(ctx)
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,11 +1,11 @@
 | 
				
			|||||||
<h4 class="ui top attached header commits-table gt-df gt-ac gt-sb">
 | 
					<h4 class="ui top attached header commits-table gt-df gt-ac gt-sb">
 | 
				
			||||||
	<div class="commits-table-left gt-df gt-ac">
 | 
						<div class="commits-table-left gt-df gt-ac">
 | 
				
			||||||
		{{if or .PageIsCommits (gt .CommitCount 0)}}
 | 
							{{if or .PageIsCommits (gt .CommitCount 0)}}
 | 
				
			||||||
			{{.CommitCount}} {{.locale.Tr "repo.commits.commits"}} {{if .RefName}}({{.RefName}}){{end}}
 | 
								{{.CommitCount}} {{.locale.Tr "repo.commits.commits"}}
 | 
				
			||||||
		{{else if .IsNothingToCompare}}
 | 
							{{else if .IsNothingToCompare}}
 | 
				
			||||||
			{{.locale.Tr "repo.commits.nothing_to_compare"}} {{if .RefName}}({{.RefName}}){{end}}
 | 
								{{.locale.Tr "repo.commits.nothing_to_compare"}}
 | 
				
			||||||
		{{else}}
 | 
							{{else}}
 | 
				
			||||||
			{{.locale.Tr "repo.commits.no_commits" $.BaseBranch $.HeadBranch}} {{if .RefName}}({{.RefName}}){{end}}
 | 
								{{.locale.Tr "repo.commits.no_commits" $.BaseBranch $.HeadBranch}}
 | 
				
			||||||
		{{end}}
 | 
							{{end}}
 | 
				
			||||||
	</div>
 | 
						</div>
 | 
				
			||||||
	<div class="commits-table-right gt-whitespace-nowrap">
 | 
						<div class="commits-table-right gt-whitespace-nowrap">
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user