---
# tasks file for qb/git/check/clean

- path_facts:
    path: >-
      {{ git_root }}
  register: git_root_facts

- set_fact:
    git_check_clean: >-
      {{
        git_root_facts.git
          | qb_send( 'clean?', ignore=git_check_clean_ignore )
      }}

# - name: >
#     Get git status for repo {{ git_root }}
#   shell: >-
#     git status
#     {% if git_check_clean_ignore_submodules %}
#       --ignore-submodules
#     {% endif %}
#     --porcelain 2>/dev/null
#   args:
#     chdir: "{{ git_root }}"
#   register: git_check_clean_status
#   changed_when: false

- name: >
    Fail if the repo at {{ git_root }} has any untracked or modified files.
  fail:
    msg: >
      Repo at {{ git_root }} can not have any untracked or
      modified files, please commit or stash and retry.
  when: (git_check_clean_status.stdout_lines | length) != 0

---
# tasks file for qb/git/check/clean

- path_facts:
    path: >-
      {{ git_root }}
  register: git_root_facts

- set_fact:
    git_check_is_clean: >-
      {{
        git_root_facts.git
          | qb_send( 'clean?', ignore=git_check_clean_ignore )
      }}

# - name: >
#     Get git status for repo {{ git_root }}
#   shell: >-
#     git status
#     {% if git_check_clean_ignore_submodules %}
#       --ignore-submodules
#     {% endif %}
#     --porcelain 2>/dev/null
#   args:
#     chdir: "{{ git_root }}"
#   register: git_check_clean_status
#   changed_when: false

- when: not git_check_is_clean
  name: >
    Fail if the repo at {{ git_root }} has any untracked or modified files.
  fail:
    msg: >
      Repo at {{ git_root }} can not have any untracked or
      modified files, please commit or stash and retry.

Fix git/check/clean to use new status from QB
Fix git/check/clean to use new status from QB
