Merge branch 'rr/ignoredandderived'
[egit/zawir.git] / org.spearce.jgit.test / tst / create-second-pack
blob03f83dcd7b8c5b449fb380e15866568bb0c085e5
1 #!/bin/bash -ex
3 export GIT_COMMITTER_NAME="A U Thor"
4 export GIT_AUTHOR_NAME="A U Thor"
5 export GIT_COMMITTER_EMAIL="a.u.thor@example.com"
6 export GIT_AUTHOR_EMAIL="a.u.thor@example.com"
8 test_tick () {
9 # from git/t/test-lib.sh
10 if test -z "${test_tick+set}"
11 then
12 test_tick=1112911993
13 else
14 test_tick=$(($test_tick + 60))
16 GIT_COMMITTER_DATE="$test_tick -0700"
17 GIT_AUTHOR_DATE="$test_tick -0700"
18 export GIT_COMMITTER_DATE GIT_AUTHOR_DATE
21 git_commit () {
22 test_tick
23 git commit "$@"
26 git_merge () {
27 test_tick
28 git merge "$@"
32 test_tick
33 rm -rf .git *.txt ?
34 git init
35 echo "On master" >>master.txt
36 git add master.txt
37 git_commit -a -m "On master"
39 echo "On master" >>master.txt
40 git_commit -a -m "On master again"
42 git checkout -b a 6c8b137b1c652731597c89668f417b8695f28dd7
43 mkdir a
45 echo a1 >>a/a1.txt
46 git add a/a1.txt
47 git_commit -a -m "First a/a1"
49 echo a2 >>a/a2.txt
50 git add a/a2.txt
51 git_commit -a -m "First a/a2"
53 git merge master
55 echo a1 >>a/a1.txt
56 git add a/a1.txt
57 git_commit -a -m "Second a/a1"
58 git branch pa
60 echo a2 >>a/a2.txt
61 git add a/a2.txt
62 git_commit -a -m "Second a/a2"
64 git checkout -b b 58be4659bb571194ed4562d04b359d26216f526e
66 mkdir b
67 echo b1 >>b/b1.txt
68 git add b/b1.txt
69 git_commit -a -m "First b/b1"
71 echo b2 >>b/b2.txt
72 git add b/b2.txt
73 git_commit -a -m "First b/b2"
75 git merge a
77 echo b1 >>b/b1.txt
78 git add b/b1.txt
79 git_commit -a -m "Second b/b1"
81 echo b2 >>b/b2.txt
82 git add b/b2.txt
83 git_commit -a -m "Second b/b2"
85 rm -rf a b c master.txt
86 mkdir c
87 rm -f ./git/index
88 echo ref: refs/heads/c >.git/HEAD
90 echo c1 >>c/c1.txt
91 git add c/c1.txt
92 git_commit -a -m "First c/c1, no parent"
94 echo c2 >>c/c2.txt
95 git add c/c2.txt
96 git_commit -a -m "First c/c2"
98 git_merge a
100 echo c1 >>c/c1.txt
101 git add c/c2.txt
102 git_commit -a -m "Second c/c1"
104 echo c2 >>c/c2.txt
105 git add c/c2.txt
106 git_commit -a -m "Second c/c2"
108 git_merge b
110 git checkout -b d a
112 echo "a1" >>a/a1
113 git add a/a1
114 git_commit -a -m "Third a/a1"
116 git checkout -b e a
118 echo "a1" >>a/a1
119 git add a/a1
120 git_commit -a -m "Fourth a/a1"
122 git checkout master
124 git_merge c d e
126 git repack -d
128 git tag A a
129 git tag -a -m "An annotated tag" B a^
131 git repack -d
133 git pack-refs --all
136 qgit --all master