summaryrefslogtreecommitdiff
path: root/test/integration/targets/git
diff options
context:
space:
mode:
authorMiyurz <Miyurz@users.noreply.github.com>2017-03-28 18:11:25 +0530
committerjctanner <tanner.jc@gmail.com>2017-03-28 08:41:25 -0400
commit1ea1becf23a09bf8208ff26370e1064596faba4d (patch)
tree3b71573571cd189036cab7cc7b253b605a90ef3b /test/integration/targets/git
parentab8578d3434c77808ff5a3792743452e079c8741 (diff)
downloadansible-1ea1becf23a09bf8208ff26370e1064596faba4d.tar.gz
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
Diffstat (limited to 'test/integration/targets/git')
-rw-r--r--test/integration/targets/git/tasks/main.yml1
-rw-r--r--test/integration/targets/git/tasks/reset-origin.yml27
2 files changed, 28 insertions, 0 deletions
diff --git a/test/integration/targets/git/tasks/main.yml b/test/integration/targets/git/tasks/main.yml
index c8ac11a1db..0f3687f21e 100644
--- a/test/integration/targets/git/tasks/main.yml
+++ b/test/integration/targets/git/tasks/main.yml
@@ -29,3 +29,4 @@
- include: checkout-new-tag.yml
- include: tag-verification.yml
- include: localmods.yml
+- include: reset-origin.yml
diff --git a/test/integration/targets/git/tasks/reset-origin.yml b/test/integration/targets/git/tasks/reset-origin.yml
new file mode 100644
index 0000000000..383c02baed
--- /dev/null
+++ b/test/integration/targets/git/tasks/reset-origin.yml
@@ -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