Debian Codegraph @

test/integration/targets/git/tasks/specific-rev-diff-check.yml

raw
1 # Test that diff is displayed together with check mode in a shallow clone
2 # when checking out a specific revision
3
4 - name: SPECIFIC-REV-DIFF-CHECK | clear checkout_dir
5 file:
6 state: absent
7 path: '{{ checkout_dir }}'
8
9 - name: SPECIFIC-REVISION-DIFF-CHECK | shallow clone
10 git:
11 repo: "{{ repo_dir }}/shallow_branches/.git"
12 dest: "{{ checkout_dir }}/ansible-repo"
13 update: true
14 version: "main"
15 depth: 1
16
17 - name: SPECIFIC-REVISION-DIFF-CHECK | check mode with diff mode specific sha bad object
18 git:
19 repo: "{{ repo_dir }}/shallow_branches/.git"
20 dest: "{{ checkout_dir }}/ansible-repo"
21 depth: 1
22 update: true
23 version: '"{{ test_branch_ref_head_id }}"'
24 check_mode: true
25 diff: true
26 register: git_result
27 ignore_errors: true
28
29 - assert:
30 that:
31 - git_result is failed
32
33 - name: SPECIFIC-REVISION-DIFF-CHECK | check and diff mode with refspec force checkout old commit sha
34 git:
35 repo: "{{ repo_dir }}/shallow_branches/.git"
36 dest: "{{ checkout_dir }}/ansible-repo"
37 depth: 1
38 update: true
39 force: true
40 version: "{{ test_branch_ref_head_id }}"
41 refspec: "{{ test_branch_ref_head_id }}:refs/remotes/origin/devel"
42 check_mode: true
43 diff: true
44 register: git_result
45
46 - assert:
47 that:
48 - prepared_string in git_result.diff.prepared
49 - git_result.after == test_branch_ref_head_id
50 vars:
51 prepared_string: diff --git a