@ -70,11 +70,11 @@
# Same as the previous test, but this time we specify which ref
# Same as the previous test, but this time we specify which ref
# contains the SHA1
# contains the SHA1
- name : SPECIFIC-REVISION | update to revision by specifying the refspec
- name : SPECIFIC-REVISION | update to revision by specifying the refspec
git:
git : &git_ref_spec
repo : https://github.com/ansible/ansible-examples.git
repo : "{{ repo_dir }}/shallow_branches/.git"
dest : '{{ checkout_dir }}'
dest : '{{ checkout_dir }}'
version : 5473e343e33255f2da0b160f53135c56921d875c
version : "{{ test_branch_ref_head_id }}"
refspec : refs/ pull/7/merge
refspec : refs/ heads/test_branch
- name : SPECIFIC-REVISION | check HEAD after update with refspec
- name : SPECIFIC-REVISION | check HEAD after update with refspec
command : git rev-parse HEAD
command : git rev-parse HEAD
@ -84,7 +84,7 @@
- assert:
- assert:
that:
that:
- 'git_result.stdout == "5473e343e33255f2da0b160f53135c56921d875c" '
- 'git_result.stdout == test_branch_ref_head_id '
# try out combination of refspec and depth
# try out combination of refspec and depth
- name : SPECIFIC-REVISION | clear checkout_dir
- name : SPECIFIC-REVISION | clear checkout_dir
@ -94,11 +94,8 @@
- name : SPECIFIC-REVISION | update to revision by specifying the refspec with depth=1
- name : SPECIFIC-REVISION | update to revision by specifying the refspec with depth=1
git:
git:
repo : https://github.com/ansible/ansible-examples.git
dest : '{{ checkout_dir }}'
version : 5473e343e33255f2da0b160f53135c56921d875c
refspec : refs/pull/7/merge
depth : 1
depth : 1
<< : *git_ref_spec
- name : SPECIFIC-REVISION | check HEAD after update with refspec
- name : SPECIFIC-REVISION | check HEAD after update with refspec
command : git rev-parse HEAD
command : git rev-parse HEAD
@ -108,7 +105,7 @@
- assert:
- assert:
that:
that:
- 'git_result.stdout == "5473e343e33255f2da0b160f53135c56921d875c" '
- 'git_result.stdout == test_branch_ref_head_id '
- name : SPECIFIC-REVISION | try to access other commit
- name : SPECIFIC-REVISION | try to access other commit
shell : git checkout 0ce1096
shell : git checkout 0ce1096
@ -130,11 +127,7 @@
path : "{{ checkout_dir }}"
path : "{{ checkout_dir }}"
- name : SPECIFIC-REVISION | clone to revision by specifying the refspec
- name : SPECIFIC-REVISION | clone to revision by specifying the refspec
git:
git : *git_ref_spec
repo : https://github.com/ansible/ansible-examples.git
dest : "{{ checkout_dir }}"
version : 5473e343e33255f2da0b160f53135c56921d875c
refspec : refs/pull/7/merge
- name : SPECIFIC-REVISION | check HEAD after update with refspec
- name : SPECIFIC-REVISION | check HEAD after update with refspec
command : git rev-parse HEAD
command : git rev-parse HEAD
@ -144,7 +137,7 @@
- assert:
- assert:
that:
that:
- 'git_result.stdout == "5473e343e33255f2da0b160f53135c56921d875c" '
- 'git_result.stdout == test_branch_ref_head_id '
# Test that a forced shallow checkout referincing branch only always fetches latest head
# Test that a forced shallow checkout referincing branch only always fetches latest head