{{ define "repo/pulls/fragments/pullStepReview" }}
{{ $root := . }}
{{ $params := .StepReviewParams }}
{{ if not $params }}
{{ if eq $root.Source "patch" }}
Paste a patch above to see a comparison.
{{ else }}
Pick a source and target above to see a comparison.
{{ end }}
{{ else if eq .Source "patch" }}
{{ else }}
{{ if $params.Commits }}
{{ $commits := $params.Commits }}
{{ len $commits }} commit{{ if ne (len $commits) 1 }}s{{ end }}
{{ if and $root.SourceBranch $root.TargetBranch }}
{{ $root.TargetBranch }}
{{ i "arrow-left-right" "w-4 h-4 flex-shrink-0" }}
{{ $root.SourceBranch }}
{{ end }}
{{ if and .SourceBranch .TargetBranch (eq .SourceBranch .TargetBranch) }}
Source and target are the same branch, nothing to merge.
{{ else }}
No commits between target and source. Make sure your source branch has commits not on the target.
{{ end }}
{{ end }}
{{ end }}
{{ end }}
{{ define "pullReviewCommits" }}
{{ $sourceRepo := index . 0 }}
{{ $commits := index . 1 }}
{{ range $commits }}
{{- $messageParts := splitN .Message "\n\n" 2 -}}
{{- $title := index $messageParts 0 -}}
{{ i "git-commit-vertical" "size-4" }}
{{ $title }}
{{ if not .Author.When.IsZero }}
{{ template "repo/fragments/shortTimeAgo" .Author.When }}
{{ end }}
{{ slice .Hash.String 0 8 }}
{{ i "folder-code" "size-4" }}