t1200: remove t1200-tutorial.sh
v1.2.0~121 (New tutorial, 2006-01-22) rewrote the tutorial such that the original intent of 2ae6c70674 (Adapt tutorial to cygwin and add test case, 2005-10-13) to test the examples from the tutorial doesn't hold any more. There are dedicated tests for the commands used, even "git whatchanged", such that removing these tests doesn't seem like a reduction in test coverage. Signed-off-by: Stefan Beller <sbeller@google.com> Acked-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Stefan Beller committed
Aug 9, 2017 at 14:22 UTC
3ae6bf9265e8c89303d1bb86ae6e00015d2eaa5f
1 file changed
-266
t/t1200-tutorial.sh
deleted
-266
@@ -1,268 +0,0 @@
1
-#!/bin/sh
2
-#
3
-# Copyright (c) 2005 Johannes Schindelin
4
-#
5
-
6
-test_description='A simple turial in the form of a test case'
7
-
8
-. ./test-lib.sh
9
-
10
-test_expect_success 'blob' '
11
- echo "Hello World" > hello &&
12
- echo "Silly example" > example &&
13
-
14
- git update-index --add hello example &&
15
-
16
- test blob = "$(git cat-file -t 557db03)"
17
-'
18
-
19
-test_expect_success 'blob 557db03' '
20
- test "Hello World" = "$(git cat-file blob 557db03)"
21
-'
22
-
23
-echo "It's a new day for git" >>hello
24
-cat > diff.expect << EOF
25
-diff --git a/hello b/hello
26
-index 557db03..263414f 100644
27
---- a/hello
28
-+++ b/hello
29
-@@ -1 +1,2 @@
30
- Hello World
31
-+It's a new day for git
32
-EOF
33
-
34
-test_expect_success 'git diff-files -p' '
35
- git diff-files -p > diff.output &&
36
- test_cmp diff.expect diff.output
37
-'
38
-
39
-test_expect_success 'git diff' '
40
- git diff > diff.output &&
41
- test_cmp diff.expect diff.output
42
-'
43
-
44
-test_expect_success 'tree' '
45
- tree=$(git write-tree 2>/dev/null) &&
46
- test 8988da15d077d4829fc51d8544c097def6644dbb = $tree
47
-'
48
-
49
-test_expect_success 'git diff-index -p HEAD' '
50
- test_tick &&
51
- tree=$(git write-tree) &&
52
- commit=$(echo "Initial commit" | git commit-tree $tree) &&
53
- git update-ref HEAD $commit &&
54
- git diff-index -p HEAD > diff.output &&
55
- test_cmp diff.expect diff.output
56
-'
57
-
58
-test_expect_success 'git diff HEAD' '
59
- git diff HEAD > diff.output &&
60
- test_cmp diff.expect diff.output
61
-'
62
-
63
-cat > whatchanged.expect << EOF
64
-commit VARIABLE
65
-Author: VARIABLE
66
-Date: VARIABLE
67
-
68
- Initial commit
69
-
70
-diff --git a/example b/example
71
-new file mode 100644
72
-index 0000000..f24c74a
73
---- /dev/null
74
-+++ b/example
75
-@@ -0,0 +1 @@
76
-+Silly example
77
-diff --git a/hello b/hello
78
-new file mode 100644
79
-index 0000000..557db03
80
---- /dev/null
81
-+++ b/hello
82
-@@ -0,0 +1 @@
83
-+Hello World
84
-EOF
85
-
86
-test_expect_success 'git whatchanged -p --root' '
87
- git whatchanged -p --root |
88
- sed -e "1s/^\(.\{7\}\).\{40\}/\1VARIABLE/" \
89
- -e "2,3s/^\(.\{8\}\).*$/\1VARIABLE/" \
90
- > whatchanged.output &&
91
- test_cmp whatchanged.expect whatchanged.output
92
-'
93
-
94
-test_expect_success 'git tag my-first-tag' '
95
- git tag my-first-tag &&
96
- test_cmp .git/refs/heads/master .git/refs/tags/my-first-tag
97
-'
98
-
99
-test_expect_success 'git checkout -b mybranch' '
100
- git checkout -b mybranch &&
101
- test_cmp .git/refs/heads/master .git/refs/heads/mybranch
102
-'
103
-
104
-cat > branch.expect <<EOF
105
- master
106
-* mybranch
107
-EOF
108
-
109
-test_expect_success 'git branch' '
110
- git branch > branch.output &&
111
- test_cmp branch.expect branch.output
112
-'
113
-
114
-test_expect_success 'git resolve now fails' '
115
- git checkout mybranch &&
116
- echo "Work, work, work" >>hello &&
117
- test_tick &&
118
- git commit -m "Some work." -i hello &&
119
-
120
- git checkout master &&
121
-
122
- echo "Play, play, play" >>hello &&
123
- echo "Lots of fun" >>example &&
124
- test_tick &&
125
- git commit -m "Some fun." -i hello example &&
126
-
127
- test_must_fail git merge -m "Merge work in mybranch" mybranch
128
-'
129
-
130
-cat > hello << EOF
131
-Hello World
132
-It's a new day for git
133
-Play, play, play
134
-Work, work, work
135
-EOF
136
-
137
-cat > show-branch.expect << EOF
138
-* [master] Merge work in mybranch
139
- ! [mybranch] Some work.
140
---
141
-- [master] Merge work in mybranch
142
-*+ [mybranch] Some work.
143
-* [master^] Some fun.
144
-EOF
145
-
146
-test_expect_success 'git show-branch' '
147
- test_tick &&
148
- git commit -m "Merge work in mybranch" -i hello &&
149
- git show-branch --topo-order --more=1 master mybranch \
150
- > show-branch.output &&
151
- test_cmp show-branch.expect show-branch.output
152
-'
153
-
154
-cat > resolve.expect << EOF
155
-Updating VARIABLE..VARIABLE
156
-FASTFORWARD (no commit created; -m option ignored)
157
- example | 1 +
158
- hello | 1 +
159
- 2 files changed, 2 insertions(+)
160
-EOF
161
-
162
-test_expect_success 'git resolve' '
163
- git checkout mybranch &&
164
- git merge -m "Merge upstream changes." master |
165
- sed -e "1s/[0-9a-f]\{7\}/VARIABLE/g" \
166
- -e "s/^Fast[- ]forward /FASTFORWARD /" >resolve.output
167
-'
168
-
169
-test_expect_success 'git resolve output' '
170
- test_i18ncmp resolve.expect resolve.output
171
-'
172
-
173
-cat > show-branch2.expect << EOF
174
-! [master] Merge work in mybranch
175
- * [mybranch] Merge work in mybranch
176
---
177
-EOF
178
-
179
-test_expect_success 'git show-branch (part 2)' '
180
- git show-branch --topo-order master mybranch > show-branch2.output &&
181
- test_cmp show-branch2.expect show-branch2.output
182
-'
183
-
184
-cat > show-branch3.expect << EOF
185
-! [master] Merge work in mybranch
186
- * [mybranch] Merge work in mybranch
187
---
188
-+* [master^2] Some work.
189
-+* [master^] Some fun.
190
-EOF
191
-
192
-test_expect_success 'git show-branch (part 3)' '
193
- git show-branch --topo-order --more=2 master mybranch \
194
- > show-branch3.output &&
195
- test_cmp show-branch3.expect show-branch3.output
196
-'
197
-
198
-test_expect_success 'rewind to "Some fun." and "Some work."' '
199
- git checkout mybranch &&
200
- git reset --hard master^2 &&
201
- git checkout master &&
202
- git reset --hard master^
203
-'
204
-
205
-cat > show-branch4.expect << EOF
206
-* [master] Some fun.
207
- ! [mybranch] Some work.
208
---
209
-* [master] Some fun.
210
- + [mybranch] Some work.
211
-*+ [master^] Initial commit
212
-EOF
213
-
214
-test_expect_success 'git show-branch (part 4)' '
215
- git show-branch --topo-order > show-branch4.output &&
216
- test_cmp show-branch4.expect show-branch4.output
217
-'
218
-
219
-test_expect_success 'manual merge' '
220
- mb=$(git merge-base HEAD mybranch) &&
221
- git name-rev --name-only --tags $mb > name-rev.output &&
222
- test "my-first-tag" = $(cat name-rev.output) &&
223
-
224
- git read-tree -m -u $mb HEAD mybranch
225
-'
226
-
227
-cat > ls-files.expect << EOF
228
-100644 7f8b141b65fdcee47321e399a2598a235a032422 0 example
229
-100644 557db03de997c86a4a028e1ebd3a1ceb225be238 1 hello
230
-100644 ba42a2a96e3027f3333e13ede4ccf4498c3ae942 2 hello
231
-100644 cc44c73eb783565da5831b4d820c962954019b69 3 hello
232
-EOF
233
-
234
-test_expect_success 'git ls-files --stage' '
235
- git ls-files --stage > ls-files.output &&
236
- test_cmp ls-files.expect ls-files.output
237
-'
238
-
239
-cat > ls-files-unmerged.expect << EOF
240
-100644 557db03de997c86a4a028e1ebd3a1ceb225be238 1 hello
241
-100644 ba42a2a96e3027f3333e13ede4ccf4498c3ae942 2 hello
242
-100644 cc44c73eb783565da5831b4d820c962954019b69 3 hello
243
-EOF
244
-
245
-test_expect_success 'git ls-files --unmerged' '
246
- git ls-files --unmerged > ls-files-unmerged.output &&
247
- test_cmp ls-files-unmerged.expect ls-files-unmerged.output
248
-'
249
-
250
-test_expect_success 'git-merge-index' '
251
- test_must_fail git merge-index git-merge-one-file hello
252
-'
253
-
254
-test_expect_success 'git ls-files --stage (part 2)' '
255
- git ls-files --stage > ls-files.output2 &&
256
- test_cmp ls-files.expect ls-files.output2
257
-'
258
-
259
-test_expect_success 'git repack' 'git repack'
260
-test_expect_success 'git prune-packed' 'git prune-packed'
261
-test_expect_success '-> only packed objects' '
262
- git prune && # Remove conflict marked blobs
263
- test $(find .git/objects/[0-9a-f][0-9a-f] -type f -print 2>/dev/null | wc -l) = 0
264
-'
265
-
266
-test_done