{{ define "repo/fragments/interdiff" }} {{ $repo := index . 0 }} {{ $x := index . 1 }} {{ $opts := index . 2 }} {{ $fileTree := fileTree $x.AffectedFiles }} {{ $diff := $x.Files }} {{ $last := sub (len $diff) 1 }} {{ $isSplit := $opts.Split }}
{{ range $idx, $hunk := $diff }} {{ with $hunk }}
{{ $markerstyle := "diff-type p-1 mr-1 font-mono text-sm rounded select-none" }} {{ if .Status.IsOk }} CHANGED {{ else if .Status.IsUnchanged }} UNCHANGED {{ else if .Status.IsOnlyInOne }} REVERTED {{ else if .Status.IsOnlyInTwo }} NEW {{ else if .Status.IsRebased }} REBASED {{ else }} ERROR {{ end }}
{{ .Name }}
{{ if .Status.IsUnchanged }}

This file has not been changed.

{{ else if .Status.IsRebased }}

This patch was likely rebased, as context lines do not match.

{{ else if .Status.IsError }}

Failed to calculate interdiff for this file.

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