ansible/test/integration/targets/git/tasks/reset-origin.yml
Miyurz 1ea1becf23 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.yml
2017-03-28 08:41:25 -04:00

27 lines
648 B
YAML

---
- 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