mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-10-22 20:13:59 -07:00
Fix git clone tag with depth=1
* Fixes #21316, add testcase based on this * Add option `--branch NAME` to git clone command in case of branch or tag in combination with depth=1 * This option should work back to at least git 1.8 and thus on all supported distributions * Provide better warning if depth is dropped
This commit is contained in:
parent
fc0ae5ee6b
commit
3afc993f3a
2 changed files with 32 additions and 5 deletions
|
@ -64,6 +64,28 @@
|
|||
args:
|
||||
chdir: '{{ checkout_dir }}'
|
||||
|
||||
- name: clear checkout_dir
|
||||
file:
|
||||
state: absent
|
||||
path: "{{ checkout_dir }}"
|
||||
|
||||
# Test for https://github.com/ansible/ansible/issues/21316
|
||||
- name: Shallow clone with tag
|
||||
git:
|
||||
repo: 'file://{{ repo_dir|expanduser }}/shallow'
|
||||
dest: '{{ checkout_dir }}'
|
||||
depth: 1
|
||||
version: earlytag
|
||||
register: cloneold
|
||||
|
||||
- assert:
|
||||
that: "cloneold|success"
|
||||
|
||||
- name: clear checkout_dir
|
||||
file:
|
||||
state: absent
|
||||
path: "{{ checkout_dir }}"
|
||||
|
||||
|
||||
# Test for https://github.com/ansible/ansible-modules-core/issues/3456
|
||||
# clone a repo with depth and version specified
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue