2017-04-04 07:19:46 +02:00
|
|
|
# test for https://github.com/ansible/ansible-modules-core/pull/3386
|
|
|
|
|
2017-10-13 16:30:15 +02:00
|
|
|
- name: AMBIGUOUS-REF | clone repo
|
2017-04-04 07:19:46 +02:00
|
|
|
git:
|
|
|
|
repo: '{{ repo_format1 }}'
|
|
|
|
dest: '{{ checkout_dir }}'
|
|
|
|
|
2017-10-13 16:30:15 +02:00
|
|
|
- name: AMBIGUOUS-REF | rename remote to be ambiguous
|
|
|
|
command: git remote rename origin v0.1
|
|
|
|
args:
|
|
|
|
chdir: "{{ checkout_dir }}"
|
2017-04-04 07:19:46 +02:00
|
|
|
|
2017-10-13 16:30:15 +02:00
|
|
|
- name: AMBIGUOUS-REF | switch to HEAD
|
2017-04-04 07:19:46 +02:00
|
|
|
git:
|
|
|
|
repo: '{{ repo_format1 }}'
|
|
|
|
dest: '{{ checkout_dir }}'
|
|
|
|
remote: v0.1
|
|
|
|
|
2017-10-13 16:30:15 +02:00
|
|
|
- name: AMBIGUOUS-REF | rev-parse remote HEAD
|
|
|
|
command: git rev-parse v0.1/HEAD
|
|
|
|
args:
|
|
|
|
chdir: "{{ checkout_dir }}"
|
2017-04-04 07:19:46 +02:00
|
|
|
register: git_remote_head
|
|
|
|
|
2017-10-13 16:30:15 +02:00
|
|
|
- name: AMBIGUOUS-REF | rev-parse local HEAD
|
|
|
|
command: git rev-parse HEAD
|
|
|
|
args:
|
|
|
|
chdir: "{{ checkout_dir }}"
|
2017-04-04 07:19:46 +02:00
|
|
|
register: git_local_head
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that: git_remote_head.stdout == git_local_head.stdout
|
|
|
|
|
2017-10-13 16:30:15 +02:00
|
|
|
- name: AMBIGUOUS-REF | clear checkout_dir
|
|
|
|
file:
|
|
|
|
state: absent
|
|
|
|
path: "{{ checkout_dir }}"
|