summaryrefslogtreecommitdiff
path: root/test/integration/targets/git/tasks/reset-origin.yml
blob: cb497c442d232d8434fad87136753629eba0035f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
- name: RESET-ORIGIN | Clean up the directories
  file:
    state: absent
    path: "{{ item }}"
  with_items:
    - "{{ repo_dir }}/origin"
    - "{{ checkout_dir }}"

- name: RESET-ORIGIN | Create a directory
  file:
    name: "{{ repo_dir }}/origin"
    state: directory

- name: RESET-ORIGIN | Initialise the repo with a file named origin,see github.com/ansible/ansible/pull/22502
  shell: |
    set -eEu

    git init

    echo "PR 22502" > origin
    git add origin
    git commit -m "PR 22502"
  args:
    chdir: "{{ repo_dir }}/origin"

- name: RESET-ORIGIN | Clone a git repo with file named origin
  git:
    repo: "{{ repo_dir }}/origin"
    dest: "{{ checkout_dir }}"
    remote: origin
    update: no
  register: status