Debian Codegraph @

test/integration/targets/git/tasks/ambiguous-ref.yml

raw
1 # test for https://github.com/ansible/ansible-modules-core/pull/3386
2
3 - name: AMBIGUOUS-REF | clone repo
4 git:
5 repo: '{{ repo_format1 }}'
6 dest: '{{ checkout_dir }}'
7
8 - name: AMBIGUOUS-REF | rename remote to be ambiguous
9 command: git remote rename origin v0.1
10 args:
11 chdir: "{{ checkout_dir }}"
12
13 - name: AMBIGUOUS-REF | switch to HEAD
14 git:
15 repo: '{{ repo_format1 }}'
16 dest: '{{ checkout_dir }}'
17 remote: v0.1
18
19 - name: AMBIGUOUS-REF | rev-parse remote HEAD
20 command: git rev-parse v0.1/HEAD
21 args:
22 chdir: "{{ checkout_dir }}"
23 register: git_remote_head
24
25 - name: AMBIGUOUS-REF | rev-parse local HEAD
26 command: git rev-parse HEAD
27 args:
28 chdir: "{{ checkout_dir }}"
29 register: git_local_head
30
31 - assert:
32 that: git_remote_head.stdout == git_local_head.stdout
33
34 - name: AMBIGUOUS-REF | clear checkout_dir
35 file:
36 state: absent
37 path: "{{ checkout_dir }}"