mirror of
https://github.com/go-gitea/gitea.git
synced 2026-05-11 07:05:21 +02:00
Fix bug
This commit is contained in:
parent
f717d4f2e5
commit
c566b49e02
@ -448,7 +448,8 @@ func PrepareCompareDiff(
|
||||
|
||||
if (headCommitID == ci.MergeBase && !ci.DirectComparison()) ||
|
||||
headCommitID == ci.BaseCommitID {
|
||||
ctx.Data["IsNothingToCompare"] = true
|
||||
ctx.Data["CommitCount"] = 0
|
||||
ctx.Data["DiffNotAvailable"] = true
|
||||
if unit, err := repo.GetUnit(ctx, unit.TypePullRequests); err == nil {
|
||||
config := unit.PullRequestsConfig()
|
||||
|
||||
@ -495,7 +496,6 @@ func PrepareCompareDiff(
|
||||
ctx.ServerError("GetDiffShortStat", err)
|
||||
return false
|
||||
}
|
||||
ctx.Data["IsNothingToCompare"] = diffShortStat.NumFiles == 0
|
||||
ctx.Data["DiffShortStat"] = diffShortStat
|
||||
ctx.Data["Diff"] = diff
|
||||
ctx.Data["DiffBlobExcerptData"] = &gitdiff.DiffBlobExcerptData{
|
||||
|
||||
@ -174,8 +174,8 @@
|
||||
</div>
|
||||
|
||||
{{if and .IsSigned .PageIsComparePull}}
|
||||
{{$allowCreatePR := and ($.CompareInfo.BaseRef.IsBranch) ($.CompareInfo.HeadRef.IsBranch) (not $.CompareInfo.DirectComparison) (or $.AllowEmptyPr (not .IsNothingToCompare))}}
|
||||
{{if .IsNothingToCompare}}
|
||||
{{$allowCreatePR := and ($.CompareInfo.BaseRef.IsBranch) ($.CompareInfo.HeadRef.IsBranch) (not $.CompareInfo.DirectComparison) (or $.AllowEmptyPr (not .DiffNotAvailable))}}
|
||||
{{if .DiffNotAvailable}}
|
||||
<div class="ui segment">
|
||||
{{if $allowCreatePR}}
|
||||
{{ctx.Locale.Tr "repo.pulls.nothing_to_compare_and_allow_empty_pr"}}
|
||||
@ -215,18 +215,20 @@
|
||||
</div>
|
||||
{{end}}
|
||||
{{else}}{{/* not singed-in or not for pull-request */}}
|
||||
{{if .IsNothingToCompare}}
|
||||
{{if .DiffNotAvailable}}
|
||||
<div class="ui segment">{{ctx.Locale.Tr "repo.commits.nothing_to_compare"}}</div>
|
||||
{{end}}
|
||||
{{end}}
|
||||
</div>
|
||||
|
||||
{{if not .IsNothingToCompare}}
|
||||
{{if or .CommitCount (not .DiffNotAvailable)}}
|
||||
<div class="ui container fluid padded tw-my-4">
|
||||
{{if .CommitCount}}
|
||||
{{template "repo/commits_table" .}}
|
||||
{{end}}
|
||||
{{template "repo/diff/box" .}}
|
||||
{{if not .DiffNotAvailable}}
|
||||
{{template "repo/diff/box" .}}
|
||||
{{end}}
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user