mirror of https://github.com/ansible/ansible.git
ansible-galaxy: Clone git collections using shallow clones (#75722)
* ansible-galaxy: Clone git collections using shallow clones This ensures the collection obtained via git url is a result of a shallow git clone (git clone --depth=1). The git history of the collection is not used by ansible, and as such, cloning the entire history of the repo is unnecessary. Signed-off-by: Tomas Babej <tomas@tbabej.com> * ansible-galaxy: Only perform shallow clones on non-versioned git urls In general, the version can be anything we can checkout (branch, tag, but also a commit hash). In particular for commit hashes we cannot perform a shallow clone. Err on the safe side and only perform shallow clones for non-versioned git urls (cloning HEAD). * galaxy-install: Make shallow cloning compatible with older Python versions Signed-off-by: Tomas Babej <tomas@tbabej.com> * Pass args as a tuple Add tests for the git command created from different repo and version combinations * changelog Co-authored-by: Tomas Babej <tomas@tbabej.com>pull/75755/head
parent
724800cd3f
commit
7ecc227488
@ -0,0 +1,5 @@
|
||||
minor_changes:
|
||||
- >-
|
||||
ansible-galaxy - Installing a collection from a git repository
|
||||
without specifying a version (or using the version ``HEAD``)
|
||||
will clone the repository using --depth=1.
|
Loading…
Reference in New Issue