Skip to content

Commit

Permalink
Merge pull request ansible#9860 from rohanpm/test_git_refspec
Browse files Browse the repository at this point in the history
test_git: add tests for `refspec' argument
  • Loading branch information
abadger committed Dec 22, 2014
2 parents 241be0d + 1ac57a8 commit cb64cd5
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions test/integration/roles/test_git/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,41 @@
that:
- 'git_result.failed'

# Same as the previous test, but this time we specify which ref
# contains the SHA1
- name: update to revision by specifying the refspec
git:
repo: https://github.com/ansible/ansible-examples.git
dest: '{{ checkout_dir }}'
version: 2cfde3668b8bb10fbe2b9d5cec486025ad8cc51b
refspec: refs/pull/7/merge

- name: check HEAD after update with refspec
command: git rev-parse HEAD chdir="{{ checkout_dir }}"
register: git_result

- assert:
that:
- 'git_result.stdout == "2cfde3668b8bb10fbe2b9d5cec486025ad8cc51b"'

- name: clear checkout_dir
file: state=absent path={{ checkout_dir }}

- name: clone to revision by specifying the refspec
git:
repo: https://github.com/ansible/ansible-examples.git
dest: '{{ checkout_dir }}'
version: 2cfde3668b8bb10fbe2b9d5cec486025ad8cc51b
refspec: refs/pull/7/merge

- name: check HEAD after update with refspec
command: git rev-parse HEAD chdir="{{ checkout_dir }}"
register: git_result

- assert:
that:
- 'git_result.stdout == "2cfde3668b8bb10fbe2b9d5cec486025ad8cc51b"'

#
# Submodule tests
#
Expand Down

0 comments on commit cb64cd5

Please sign in to comment.