diff options
author | Robin Roth <robin.roth@kit.edu> | 2017-02-21 14:22:29 +0100 |
---|---|---|
committer | Toshio Kuratomi <a.badger@gmail.com> | 2017-03-02 23:11:50 +0100 |
commit | 3afc993f3a5774f61b6a9b6ed4ea1136821f91ef (patch) | |
tree | 7acfe9cf718ec4815f311f55e3c4fc863b3f8f72 /test/integration/targets/git | |
parent | [cloud][test] Use pytest conditional imports instead of nose/SkipTest (#22019) (diff) | |
download | ansible-3afc993f3a5774f61b6a9b6ed4ea1136821f91ef.tar.xz ansible-3afc993f3a5774f61b6a9b6ed4ea1136821f91ef.zip |
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
Diffstat (limited to 'test/integration/targets/git')
-rw-r--r-- | test/integration/targets/git/tasks/depth.yml | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/test/integration/targets/git/tasks/depth.yml b/test/integration/targets/git/tasks/depth.yml index a60299f3e2..e08f08b5fb 100644 --- a/test/integration/targets/git/tasks/depth.yml +++ b/test/integration/targets/git/tasks/depth.yml @@ -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 |