{# Rendered even with nothing to show: the empty state tells people to
turn on Unstaged or Untracked, so the toggles have to be reachable. #}
{{ render_partial('partials/global_controls.html',
unstaged=unstaged,
untracked=untracked,
is_head_comparison=is_head_comparison,
has_files=(groups and total_files)) }}
{{ render_partial('partials/filtered_empty_state.html') }}
{% if not groups or not total_files %}
{{ render_partial('partials/empty_state.html',
error=error,
unstaged=unstaged,
untracked=untracked,
current_base_ref=current_base_ref) }}
{% else %}
{% if not is_head_comparison and not untracked and groups.get('changes') %}
{% for file in groups['changes'].files %}
{% set group_name = 'changes' %}
{% include 'diff_file.html' with context %}
{% endfor %}
{% elif not untracked and groups.get('changes') %}
{% for file in groups['changes'].files %}
{% set group_name = 'changes' %}
{% include 'diff_file.html' with context %}
{% endfor %}
{% else %}
{% include "diff_groups.html" %}
{% endif %}
{% endif %}