2017-10-13 16:30:15 +02:00
|
|
|
- name: SETUP-LOCAL-REPOS | create dirs
|
2017-01-06 23:38:53 +01:00
|
|
|
file:
|
2017-10-13 16:30:15 +02:00
|
|
|
name: "{{ item }}"
|
2017-01-06 23:38:53 +01:00
|
|
|
state: directory
|
|
|
|
with_items:
|
2017-10-13 16:30:15 +02:00
|
|
|
- "{{ repo_dir }}/minimal"
|
|
|
|
- "{{ repo_dir }}/shallow"
|
2018-02-08 00:07:02 +01:00
|
|
|
- "{{ repo_dir }}/shallow_branches"
|
2017-01-06 23:38:53 +01:00
|
|
|
|
2017-10-13 16:30:15 +02:00
|
|
|
- name: SETUP-LOCAL-REPOS | prepare minimal git repo
|
2017-01-06 23:38:53 +01:00
|
|
|
shell: git init; echo "1" > a; git add a; git commit -m "1"
|
|
|
|
args:
|
2017-10-13 16:30:15 +02:00
|
|
|
chdir: "{{ repo_dir }}/minimal"
|
2017-01-06 23:38:53 +01:00
|
|
|
|
2017-10-13 16:30:15 +02:00
|
|
|
- name: SETUP-LOCAL-REPOS | prepare git repo for shallow clone
|
2017-01-06 23:38:53 +01:00
|
|
|
shell: |
|
|
|
|
git init;
|
|
|
|
echo "1" > a; git add a; git commit -m "1"; git tag earlytag; git branch earlybranch;
|
|
|
|
echo "2" > a; git add a; git commit -m "2";
|
|
|
|
args:
|
2017-10-13 16:30:15 +02:00
|
|
|
chdir: "{{ repo_dir }}/shallow"
|
2017-01-06 23:38:53 +01:00
|
|
|
|
2017-10-13 16:30:15 +02:00
|
|
|
- name: SETUP-LOCAL-REPOS | set old hash var for shallow test
|
2017-01-06 23:38:53 +01:00
|
|
|
command: 'git rev-parse HEAD~1'
|
|
|
|
register: git_shallow_head_1
|
|
|
|
args:
|
2017-10-13 16:30:15 +02:00
|
|
|
chdir: "{{ repo_dir }}/shallow"
|
2018-02-08 00:07:02 +01:00
|
|
|
|
|
|
|
- name: prepare tmp git repo with two branches
|
|
|
|
shell: |
|
|
|
|
git init
|
|
|
|
echo "1" > a; git add a; git commit -m "1"
|
|
|
|
git checkout -b test_branch; echo "2" > a; git commit -m "2 on branch" a
|
|
|
|
git checkout -b new_branch; echo "3" > a; git commit -m "3 on new branch" a
|
|
|
|
args:
|
|
|
|
chdir: "{{ repo_dir }}/shallow_branches"
|