Skip to content

Commit 6183a6a

Browse files
bebarinogitster
authored andcommitted
t6200: modernize with test_tick
This test defines its own version of test_tick. Get rid of it. Signed-off-by: Stephen Boyd <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 419fe5b commit 6183a6a

File tree

1 file changed

+29
-35
lines changed

1 file changed

+29
-35
lines changed

t/t6200-fmt-merge-msg.sh

Lines changed: 29 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -7,65 +7,59 @@ test_description='fmt-merge-msg test'
77

88
. ./test-lib.sh
99

10-
datestamp=1151939923
11-
setdate () {
12-
GIT_COMMITTER_DATE="$datestamp +0200"
13-
GIT_AUTHOR_DATE="$datestamp +0200"
14-
datestamp=`expr "$datestamp" + 1`
15-
export GIT_COMMITTER_DATE GIT_AUTHOR_DATE
16-
}
17-
1810
test_expect_success setup '
1911
echo one >one &&
2012
git add one &&
21-
setdate &&
13+
test_tick &&
2214
git commit -m "Initial" &&
2315
2416
git clone . remote &&
2517
2618
echo uno >one &&
2719
echo dos >two &&
2820
git add two &&
29-
setdate &&
21+
test_tick &&
3022
git commit -a -m "Second" &&
3123
3224
git checkout -b left &&
3325
34-
echo $datestamp >one &&
35-
setdate &&
26+
echo "c1" >one &&
27+
test_tick &&
3628
git commit -a -m "Common #1" &&
3729
38-
echo $datestamp >one &&
39-
setdate &&
30+
echo "c2" >one &&
31+
test_tick &&
4032
git commit -a -m "Common #2" &&
4133
4234
git branch right &&
4335
44-
echo $datestamp >two &&
45-
setdate &&
36+
echo "l3" >two &&
37+
test_tick &&
4638
git commit -a -m "Left #3" &&
4739
48-
echo $datestamp >two &&
49-
setdate &&
40+
echo "l4" >two &&
41+
test_tick &&
5042
git commit -a -m "Left #4" &&
5143
52-
echo $datestamp >two &&
53-
setdate &&
44+
echo "l5" >two &&
45+
test_tick &&
5446
git commit -a -m "Left #5" &&
47+
git tag tag-l5 &&
5548
5649
git checkout right &&
5750
58-
echo $datestamp >three &&
51+
echo "r3" >three &&
5952
git add three &&
60-
setdate &&
53+
test_tick &&
6154
git commit -a -m "Right #3" &&
55+
git tag tag-r3 &&
6256
63-
echo $datestamp >three &&
64-
setdate &&
57+
echo "r4" >three &&
58+
test_tick &&
6559
git commit -a -m "Right #4" &&
6660
67-
echo $datestamp >three &&
68-
setdate &&
61+
echo "r5" >three &&
62+
test_tick &&
6963
git commit -a -m "Right #5" &&
7064
7165
git show-branch
@@ -115,7 +109,7 @@ test_expect_success 'merge-msg test #3-1' '
115109
git config merge.log true &&
116110
117111
git checkout master &&
118-
setdate &&
112+
test_tick &&
119113
git fetch . left &&
120114
121115
git fmt-merge-msg <.git/FETCH_HEAD >actual &&
@@ -129,7 +123,7 @@ test_expect_success 'merge-msg test #3-2' '
129123
git config merge.summary true &&
130124
131125
git checkout master &&
132-
setdate &&
126+
test_tick &&
133127
git fetch . left &&
134128
135129
git fmt-merge-msg <.git/FETCH_HEAD >actual &&
@@ -161,7 +155,7 @@ test_expect_success 'merge-msg test #4-1' '
161155
git config merge.log true &&
162156
163157
git checkout master &&
164-
setdate &&
158+
test_tick &&
165159
git fetch . left right &&
166160
167161
git fmt-merge-msg <.git/FETCH_HEAD >actual &&
@@ -175,7 +169,7 @@ test_expect_success 'merge-msg test #4-2' '
175169
git config merge.summary true &&
176170
177171
git checkout master &&
178-
setdate &&
172+
test_tick &&
179173
git fetch . left right &&
180174
181175
git fmt-merge-msg <.git/FETCH_HEAD >actual &&
@@ -189,7 +183,7 @@ test_expect_success 'merge-msg test #5-1' '
189183
git config merge.log yes &&
190184
191185
git checkout master &&
192-
setdate &&
186+
test_tick &&
193187
git fetch . left right &&
194188
195189
git fmt-merge-msg <.git/FETCH_HEAD >actual &&
@@ -203,7 +197,7 @@ test_expect_success 'merge-msg test #5-2' '
203197
git config merge.summary yes &&
204198
205199
git checkout master &&
206-
setdate &&
200+
test_tick &&
207201
git fetch . left right &&
208202
209203
git fmt-merge-msg <.git/FETCH_HEAD >actual &&
@@ -217,7 +211,7 @@ test_expect_success 'merge-msg -F' '
217211
git config merge.summary yes &&
218212
219213
git checkout master &&
220-
setdate &&
214+
test_tick &&
221215
git fetch . left right &&
222216
223217
git fmt-merge-msg -F .git/FETCH_HEAD >actual &&
@@ -231,7 +225,7 @@ test_expect_success 'merge-msg -F in subdirectory' '
231225
git config merge.summary yes &&
232226
233227
git checkout master &&
234-
setdate &&
228+
test_tick &&
235229
git fetch . left right &&
236230
mkdir sub &&
237231
cp .git/FETCH_HEAD sub/FETCH_HEAD &&
@@ -251,7 +245,7 @@ test_expect_success 'merge-msg with nothing to merge' '
251245
(
252246
cd remote &&
253247
git checkout -b unrelated &&
254-
setdate &&
248+
test_tick &&
255249
git fetch origin &&
256250
git fmt-merge-msg <.git/FETCH_HEAD >../actual
257251
) &&

0 commit comments

Comments
 (0)