|
1 | | -#!/bin/sh |
2 | | -#creates push_src repo for libgit2 push tests. |
3 | | -set -eu |
4 | | - |
5 | | -#Create src repo for push |
6 | | -mkdir push_src |
7 | | -pushd push_src |
8 | | - git init |
9 | | - |
10 | | - echo a > a.txt |
11 | | - git add . |
12 | | - git commit -m 'added a.txt' |
13 | | - |
14 | | - mkdir fold |
15 | | - echo b > fold/b.txt |
16 | | - git add . |
17 | | - git commit -m 'added fold and fold/b.txt' |
18 | | - |
19 | | - git branch b1 #b1 and b2 are the same |
20 | | - git branch b2 |
21 | | - |
22 | | - git checkout -b b3 |
23 | | - echo edit >> a.txt |
24 | | - git add . |
25 | | - git commit -m 'edited a.txt' |
26 | | - |
27 | | - git checkout -b b4 master |
28 | | - echo edit >> fold\b.txt |
29 | | - git add . |
30 | | - git commit -m 'edited fold\b.txt' |
31 | | - |
32 | | - git checkout -b b5 master |
33 | | - git submodule add ../testrepo.git submodule |
34 | | - git commit -m "added submodule named 'submodule' pointing to '../testrepo.git'" |
35 | | - |
36 | | - git checkout master |
37 | | - git merge -m "merge b3, b4, and b5 to master" b3 b4 b5 |
38 | | - |
39 | | - #Log commits to include in testcase |
40 | | - git log --format=oneline --decorate --graph |
41 | | - #*-. 951bbbb90e2259a4c8950db78946784fb53fcbce (HEAD, master) merge b3, b4, and b5 to master |
42 | | - #|\ \ |
43 | | - #| | * fa38b91f199934685819bea316186d8b008c52a2 (b5) added submodule named 'submodule' pointing to '../testrepo.git' |
44 | | - #| * | 27b7ce66243eb1403862d05f958c002312df173d (b4) edited fold\b.txt |
45 | | - #| |/ |
46 | | - #* | d9b63a88223d8367516f50bd131a5f7349b7f3e4 (b3) edited a.txt |
47 | | - #|/ |
48 | | - #* a78705c3b2725f931d3ee05348d83cc26700f247 (b2, b1) added fold and fold/b.txt |
49 | | - #* 5c0bb3d1b9449d1cc69d7519fd05166f01840915 added a.txt |
50 | | - |
51 | | - #fix paths so that we can add repo folders under libgit2 repo |
52 | | - #rename .git to .gitted |
53 | | - find . -name .git -exec mv -i '{}' '{}ted' \; |
54 | | - mv -i .gitmodules gitmodules |
55 | | -popd |
| 1 | +#!/bin/sh |
| 2 | +#creates push_src repo for libgit2 push tests. |
| 3 | +set -eu |
| 4 | + |
| 5 | +#Create src repo for push |
| 6 | +mkdir push_src |
| 7 | +pushd push_src |
| 8 | + git init |
| 9 | + |
| 10 | + echo a > a.txt |
| 11 | + git add . |
| 12 | + git commit -m 'added a.txt' |
| 13 | + |
| 14 | + mkdir fold |
| 15 | + echo b > fold/b.txt |
| 16 | + git add . |
| 17 | + git commit -m 'added fold and fold/b.txt' |
| 18 | + |
| 19 | + git branch b1 #b1 and b2 are the same |
| 20 | + git branch b2 |
| 21 | + |
| 22 | + git checkout -b b3 |
| 23 | + echo edit >> a.txt |
| 24 | + git add . |
| 25 | + git commit -m 'edited a.txt' |
| 26 | + |
| 27 | + git checkout -b b4 master |
| 28 | + echo edit >> fold\b.txt |
| 29 | + git add . |
| 30 | + git commit -m 'edited fold\b.txt' |
| 31 | + |
| 32 | + git checkout -b b5 master |
| 33 | + git submodule add ../testrepo.git submodule |
| 34 | + git commit -m "added submodule named 'submodule' pointing to '../testrepo.git'" |
| 35 | + |
| 36 | + git checkout master |
| 37 | + git merge -m "merge b3, b4, and b5 to master" b3 b4 b5 |
| 38 | + |
| 39 | + #Log commits to include in testcase |
| 40 | + git log --format=oneline --decorate --graph |
| 41 | + #*-. 951bbbb90e2259a4c8950db78946784fb53fcbce (HEAD, master) merge b3, b4, and b5 to master |
| 42 | + #|\ \ |
| 43 | + #| | * fa38b91f199934685819bea316186d8b008c52a2 (b5) added submodule named 'submodule' pointing to '../testrepo.git' |
| 44 | + #| * | 27b7ce66243eb1403862d05f958c002312df173d (b4) edited fold\b.txt |
| 45 | + #| |/ |
| 46 | + #* | d9b63a88223d8367516f50bd131a5f7349b7f3e4 (b3) edited a.txt |
| 47 | + #|/ |
| 48 | + #* a78705c3b2725f931d3ee05348d83cc26700f247 (b2, b1) added fold and fold/b.txt |
| 49 | + #* 5c0bb3d1b9449d1cc69d7519fd05166f01840915 added a.txt |
| 50 | + |
| 51 | + #fix paths so that we can add repo folders under libgit2 repo |
| 52 | + #rename .git to .gitted |
| 53 | + find . -name .git -exec mv -i '{}' '{}ted' \; |
| 54 | + mv -i .gitmodules gitmodules |
| 55 | +popd |
0 commit comments