{{ define "repo/fragments/diff" }} {{ $repo := index . 0 }} {{ $diff := index . 1 }} {{ $opts := index . 2 }} {{ $commit := $diff.Commit }} {{ $diff := $diff.Diff }} {{ $isSplit := $opts.Split }} {{ $this := $commit.This }} {{ $parent := $commit.Parent }} {{ $last := sub (len $diff) 1 }}
{{ if eq (len $diff) 0 }}

No differences found between the selected revisions.

{{ else }} {{ range $idx, $hunk := $diff }} {{ with $hunk }}
{{ i "chevron-right" "w-4 h-4" }} {{ template "repo/fragments/diffStatPill" .Stats }}
{{ if .IsDelete }} {{ .Name.Old }} {{ else if (or .IsCopy .IsRename) }} {{ .Name.Old }} {{ i "arrow-right" "w-4 h-4" }} {{ .Name.New }} {{ else }} {{ .Name.New }} {{ end }}
{{ if .IsBinary }}

This is a binary file and will not be displayed.

{{ else }} {{ if $isSplit }} {{- template "repo/fragments/splitDiff" .Split -}} {{ else }} {{- template "repo/fragments/unifiedDiff" . -}} {{ end }} {{- end -}}
{{ end }} {{ end }} {{ end }}
{{ end }}