mirror of https://github.com/ansible/ansible.git
Fixes bug https://github.com/ansible/ansible/issues/22455 - Git reset… (#22502)
* Fixes bug https://github.com/ansible/ansible/issues/22455 - Git reset fails when file with the name 'origin' is present in the repository * #22455 Integration test for git module to test if it clones a repository with a file named origin * Fixed yaml errors for test/integration/roles/test_git_clone/tasks/main.yml * Removed the newly added target git and moved the code to test/integration/targets/git * Reorganised code structure as per comments * Fixed playbook name * Added code that didn't make it to the playbook before. * No longer need git.yml * Remove non tasks specific code from tasks file and use existing variables * Removed msg var from the vars.ymlpull/23035/head
parent
ab8578d343
commit
1ea1becf23
@ -0,0 +1,27 @@
|
||||
---
|
||||
|
||||
- name: Clean up the directories
|
||||
file:
|
||||
state: absent
|
||||
path: "{{ item }}"
|
||||
with_items:
|
||||
- "{{ repo_dir }}/origin"
|
||||
- "{{ checkout_dir }}"
|
||||
|
||||
- name: Create a directory
|
||||
file:
|
||||
name: "{{ repo_dir }}/origin"
|
||||
state: directory
|
||||
|
||||
- name: Initialise the repo with a file named origin,see github.com/ansible/ansible/pull/22502
|
||||
shell: git init; echo "PR 22502" > origin; git add origin; git commit -m "PR 22502"
|
||||
args:
|
||||
chdir: "{{ repo_dir }}/origin"
|
||||
|
||||
- name: Clone a git repo with file named origin
|
||||
git:
|
||||
repo: "{{ repo_dir }}/origin"
|
||||
dest: "{{ checkout_dir }}"
|
||||
remote: origin
|
||||
update: no
|
||||
register: status
|
Loading…
Reference in New Issue