{{template "base/head" .}}
{{template "repo/header" .}}

{{if and $.PageIsComparePull $.IsSigned (not .Repository.IsArchived)}} {{.i18n.Tr "repo.pulls.compare_changes"}}
{{.i18n.Tr "repo.pulls.compare_changes_desc"}}
{{ else }} {{.i18n.Tr "action.compare_commits_general"}} {{ end }}

{{ $BaseCompareName := $.BaseName -}} {{- $HeadCompareName := $.HeadRepo.OwnerName -}} {{- if and (eq $.BaseName $.HeadRepo.OwnerName) (ne $.Repository.Name $.HeadRepo.Name) -}} {{- $HeadCompareName = printf "%s/%s" $.HeadRepo.OwnerName $.HeadRepo.Name -}} {{- end -}} {{- $OwnForkCompareName := "" -}} {{- if .OwnForkRepo -}} {{- $OwnForkCompareName = .OwnForkRepo.OwnerName -}} {{- end -}} {{- $RootRepoCompareName := "" -}} {{- if .RootRepo -}} {{- $RootRepoCompareName = .RootRepo.OwnerName -}} {{- if eq $.HeadRepo.OwnerName .RootRepo.OwnerName -}} {{- $HeadCompareName = printf "%s/%s" $.HeadRepo.OwnerName $.HeadRepo.Name -}} {{- end -}} {{- if .OwnForkRepo -}} {{- if eq $.OwnForkRepo.OwnerName .RootRepo.OwnerName -}} {{- $OwnForkRepoCompareName = printf "%s/%s" $.OwnForkRepo.OwnerName $.OwnForkRepo.Name -}} {{- end -}} {{- end -}} {{- end -}}
{{svg "octicon-git-compare"}} {{.CompareSeparator}}
{{if .IsNothingToCompare}} {{if and $.IsSigned $.AllowEmptyPr (not .Repository.IsArchived) }}
{{.i18n.Tr "repo.pulls.nothing_to_compare_and_allow_empty_pr"}}
{{template "repo/issue/new_form" .}}
{{else}}
{{.i18n.Tr "repo.pulls.nothing_to_compare"}}
{{end}} {{else if and .PageIsComparePull (gt .CommitCount 0)}} {{if .HasPullRequest}}
{{.i18n.Tr "repo.pulls.has_pull_request" (Escape $.RepoLink) (Escape $.RepoRelPath) .PullRequest.Index | Safe}}
{{else}} {{if and $.IsSigned (not .Repository.IsArchived)}}
{{else if .Repository.IsArchived}}
{{.i18n.Tr "repo.archive.title"}}
{{end}} {{if $.IsSigned}}
{{template "repo/issue/new_form" .}}
{{end}} {{template "repo/commits_table" .}} {{template "repo/diff/box" .}} {{end}} {{else}} {{template "repo/commits_table" .}} {{template "repo/diff/box" .}} {{end}}
{{template "base/footer" .}}