remote-helpers: test: cleanup white-spaces

We prefer tabs to spaces. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Felipe Contreras committed May 24, 2013 at 21:29 UTC 4080ac81e5435ce0d1acbe08916190a7513aae2b
2 files changed +318 -318
contrib/remote-helpers/test-bzr.sh
+230 -230
@@ -29,69 +29,69 @@ check () {
29 bzr whoami "A U Thor <author@example.com>"
30
31 test_expect_success 'cloning' '
32 - (bzr init bzrrepo &&
33 - cd bzrrepo &&
34 - echo one > content &&
35 - bzr add content &&
36 - bzr commit -m one
37 - ) &&
38 -
39 - git clone "bzr::$PWD/bzrrepo" gitrepo &&
40 - check gitrepo one master
32 + (bzr init bzrrepo &&
33 + cd bzrrepo &&
34 + echo one > content &&
35 + bzr add content &&
36 + bzr commit -m one
37 + ) &&
38 +
39 + git clone "bzr::$PWD/bzrrepo" gitrepo &&
40 + check gitrepo one master
41 '
42
43 test_expect_success 'pulling' '
44 - (cd bzrrepo &&
45 - echo two > content &&
46 - bzr commit -m two
47 - ) &&
44 + (cd bzrrepo &&
45 + echo two > content &&
46 + bzr commit -m two
47 + ) &&
48
49 - (cd gitrepo && git pull) &&
49 + (cd gitrepo && git pull) &&
50
51 - check gitrepo two master
51 + check gitrepo two master
52 '
53
54 test_expect_success 'pushing' '
55 - (cd gitrepo &&
56 - echo three > content &&
57 - git commit -a -m three &&
58 - git push
59 - ) &&
60 -
61 - echo three > expected &&
62 - cat bzrrepo/content > actual &&
63 - test_cmp expected actual
55 + (cd gitrepo &&
56 + echo three > content &&
57 + git commit -a -m three &&
58 + git push
59 + ) &&
60 +
61 + echo three > expected &&
62 + cat bzrrepo/content > actual &&
63 + test_cmp expected actual
64 '
65
66 test_expect_success 'roundtrip' '
67 - (cd gitrepo &&
68 - git pull &&
69 - git log --format="%s" -1 origin/master > actual) &&
70 - echo three > expected &&
71 - test_cmp expected actual &&
67 + (cd gitrepo &&
68 + git pull &&
69 + git log --format="%s" -1 origin/master > actual) &&
70 + echo three > expected &&
71 + test_cmp expected actual &&
72
73 - (cd gitrepo && git push && git pull) &&
73 + (cd gitrepo && git push && git pull) &&
74
75 - (cd bzrrepo &&
76 - echo four > content &&
77 - bzr commit -m four
78 - ) &&
75 + (cd bzrrepo &&
76 + echo four > content &&
77 + bzr commit -m four
78 + ) &&
79
80 - (cd gitrepo && git pull && git push) &&
80 + (cd gitrepo && git pull && git push) &&
81
82 - check gitrepo four master &&
82 + check gitrepo four master &&
83
84 - (cd gitrepo &&
85 - echo five > content &&
86 - git commit -a -m five &&
87 - git push && git pull
88 - ) &&
84 + (cd gitrepo &&
85 + echo five > content &&
86 + git commit -a -m five &&
87 + git push && git pull
88 + ) &&
89
90 - (cd bzrrepo && bzr revert) &&
90 + (cd bzrrepo && bzr revert) &&
91
92 - echo five > expected &&
93 - cat bzrrepo/content > actual &&
94 - test_cmp expected actual
92 + echo five > expected &&
93 + cat bzrrepo/content > actual &&
94 + test_cmp expected actual
95 '
96
97 cat > expected <<EOF
@@ -101,29 +101,29 @@ cat > expected <<EOF
101 EOF
102
103 test_expect_success 'special modes' '
104 - (cd bzrrepo &&
105 - echo exec > executable
106 - chmod +x executable &&
107 - bzr add executable
108 - bzr commit -m exec &&
109 - ln -s content link
110 - bzr add link
111 - bzr commit -m link &&
112 - mkdir dir &&
113 - bzr add dir &&
114 - bzr commit -m dir) &&
115 -
116 - (cd gitrepo &&
117 - git pull
118 - git ls-tree HEAD > ../actual) &&
119 -
120 - test_cmp expected actual &&
121 -
122 - (cd gitrepo &&
123 - git cat-file -p HEAD:link > ../actual) &&
124 -
125 - printf content > expected &&
126 - test_cmp expected actual
104 + (cd bzrrepo &&
105 + echo exec > executable
106 + chmod +x executable &&
107 + bzr add executable
108 + bzr commit -m exec &&
109 + ln -s content link
110 + bzr add link
111 + bzr commit -m link &&
112 + mkdir dir &&
113 + bzr add dir &&
114 + bzr commit -m dir) &&
115 +
116 + (cd gitrepo &&
117 + git pull
118 + git ls-tree HEAD > ../actual) &&
119 +
120 + test_cmp expected actual &&
121 +
122 + (cd gitrepo &&
123 + git cat-file -p HEAD:link > ../actual) &&
124 +
125 + printf content > expected &&
126 + test_cmp expected actual
127 '
128
129 cat > expected <<EOF
@@ -134,134 +134,134 @@ cat > expected <<EOF
134 EOF
135
136 test_expect_success 'moving directory' '
137 - (cd bzrrepo &&
138 - mkdir movedir &&
139 - echo one > movedir/one &&
140 - echo two > movedir/two &&
141 - bzr add movedir &&
142 - bzr commit -m movedir &&
143 - bzr mv movedir movedir-new &&
144 - bzr commit -m movedir-new) &&
145 -
146 - (cd gitrepo &&
147 - git pull &&
148 - git ls-tree HEAD > ../actual) &&
149 -
150 - test_cmp expected actual
137 + (cd bzrrepo &&
138 + mkdir movedir &&
139 + echo one > movedir/one &&
140 + echo two > movedir/two &&
141 + bzr add movedir &&
142 + bzr commit -m movedir &&
143 + bzr mv movedir movedir-new &&
144 + bzr commit -m movedir-new) &&
145 +
146 + (cd gitrepo &&
147 + git pull &&
148 + git ls-tree HEAD > ../actual) &&
149 +
150 + test_cmp expected actual
151 '
152
153 test_expect_success 'different authors' '
154 - (cd bzrrepo &&
155 - echo john >> content &&
156 - bzr commit -m john \
157 - --author "Jane Rey <jrey@example.com>" \
158 - --author "John Doe <jdoe@example.com>") &&
159 -
160 - (cd gitrepo &&
161 - git pull &&
162 - git show --format="%an <%ae>, %cn <%ce>" --quiet > ../actual) &&
163 -
164 - echo "Jane Rey <jrey@example.com>, A U Thor <author@example.com>" > expected &&
165 - test_cmp expected actual
154 + (cd bzrrepo &&
155 + echo john >> content &&
156 + bzr commit -m john \
157 + --author "Jane Rey <jrey@example.com>" \
158 + --author "John Doe <jdoe@example.com>") &&
159 +
160 + (cd gitrepo &&
161 + git pull &&
162 + git show --format="%an <%ae>, %cn <%ce>" --quiet > ../actual) &&
163 +
164 + echo "Jane Rey <jrey@example.com>, A U Thor <author@example.com>" > expected &&
165 + test_cmp expected actual
166 '
167
168 test_expect_success 'fetch utf-8 filenames' '
169 - mkdir -p tmp && cd tmp &&
170 - test_when_finished "cd .. && rm -rf tmp && LC_ALL=C" &&
171 -
172 - LC_ALL=en_US.UTF-8
173 - export LC_ALL
174 - (
175 - bzr init bzrrepo &&
176 - cd bzrrepo &&
177 -
178 - echo test >> "ærø" &&
179 - bzr add "ærø" &&
180 - echo test >> "ø~?" &&
181 - bzr add "ø~?" &&
182 - bzr commit -m add-utf-8 &&
183 - echo test >> "ærø" &&
184 - bzr commit -m test-utf-8 &&
185 - bzr rm "ø~?" &&
186 - bzr mv "ærø" "ø~?" &&
187 - bzr commit -m bzr-mv-utf-8
188 - ) &&
189 -
190 - (
191 - git clone "bzr::$PWD/bzrrepo" gitrepo &&
192 - cd gitrepo &&
193 - git -c core.quotepath=false ls-files > ../actual
194 - ) &&
195 - echo "ø~?" > expected &&
196 - test_cmp expected actual
169 + mkdir -p tmp && cd tmp &&
170 + test_when_finished "cd .. && rm -rf tmp && LC_ALL=C" &&
171 +
172 + LC_ALL=en_US.UTF-8
173 + export LC_ALL
174 + (
175 + bzr init bzrrepo &&
176 + cd bzrrepo &&
177 +
178 + echo test >> "ærø" &&
179 + bzr add "ærø" &&
180 + echo test >> "ø~?" &&
181 + bzr add "ø~?" &&
182 + bzr commit -m add-utf-8 &&
183 + echo test >> "ærø" &&
184 + bzr commit -m test-utf-8 &&
185 + bzr rm "ø~?" &&
186 + bzr mv "ærø" "ø~?" &&
187 + bzr commit -m bzr-mv-utf-8
188 + ) &&
189 +
190 + (
191 + git clone "bzr::$PWD/bzrrepo" gitrepo &&
192 + cd gitrepo &&
193 + git -c core.quotepath=false ls-files > ../actual
194 + ) &&
195 + echo "ø~?" > expected &&
196 + test_cmp expected actual
197 '
198
199 test_expect_success 'push utf-8 filenames' '
200 - mkdir -p tmp && cd tmp &&
201 - test_when_finished "cd .. && rm -rf tmp && LC_ALL=C" &&
200 + mkdir -p tmp && cd tmp &&
201 + test_when_finished "cd .. && rm -rf tmp && LC_ALL=C" &&
202
203 - LC_ALL=en_US.UTF-8
204 - export LC_ALL
203 + LC_ALL=en_US.UTF-8
204 + export LC_ALL
205
206 - (
207 - bzr init bzrrepo &&
208 - cd bzrrepo &&
206 + (
207 + bzr init bzrrepo &&
208 + cd bzrrepo &&
209
210 - echo one >> content &&
211 - bzr add content &&
212 - bzr commit -m one
213 - ) &&
210 + echo one >> content &&
211 + bzr add content &&
212 + bzr commit -m one
213 + ) &&
214
215 - (
216 - git clone "bzr::$PWD/bzrrepo" gitrepo &&
217 - cd gitrepo &&
215 + (
216 + git clone "bzr::$PWD/bzrrepo" gitrepo &&
217 + cd gitrepo &&
218
219 - echo test >> "ærø" &&
220 - git add "ærø" &&
221 - git commit -m utf-8 &&
219 + echo test >> "ærø" &&
220 + git add "ærø" &&
221 + git commit -m utf-8 &&
222
223 - git push
224 - ) &&
223 + git push
224 + ) &&
225
226 - (cd bzrrepo && bzr ls > ../actual) &&
227 - printf "content\nærø\n" > expected &&
228 - test_cmp expected actual
226 + (cd bzrrepo && bzr ls > ../actual) &&
227 + printf "content\nærø\n" > expected &&
228 + test_cmp expected actual
229 '
230
231 test_expect_success 'pushing a merge' '
232 - mkdir -p tmp && cd tmp &&
233 - test_when_finished "cd .. && rm -rf tmp" &&
234 -
235 - (
236 - bzr init bzrrepo &&
237 - cd bzrrepo &&
238 - echo one > content &&
239 - bzr add content &&
240 - bzr commit -m one
241 - ) &&
242 -
243 - git clone "bzr::$PWD/bzrrepo" gitrepo &&
244 -
245 - (
246 - cd bzrrepo &&
247 - echo two > content &&
248 - bzr commit -m two
249 - ) &&
250 -
251 - (
252 - cd gitrepo &&
253 - echo three > content &&
254 - git commit -a -m three &&
255 - git fetch &&
256 - git merge origin/master || true &&
257 - echo three > content &&
258 - git commit -a --no-edit &&
259 - git push
260 - ) &&
261 -
262 - echo three > expected &&
263 - cat bzrrepo/content > actual &&
264 - test_cmp expected actual
232 + mkdir -p tmp && cd tmp &&
233 + test_when_finished "cd .. && rm -rf tmp" &&
234 +
235 + (
236 + bzr init bzrrepo &&
237 + cd bzrrepo &&
238 + echo one > content &&
239 + bzr add content &&
240 + bzr commit -m one
241 + ) &&
242 +
243 + git clone "bzr::$PWD/bzrrepo" gitrepo &&
244 +
245 + (
246 + cd bzrrepo &&
247 + echo two > content &&
248 + bzr commit -m two
249 + ) &&
250 +
251 + (
252 + cd gitrepo &&
253 + echo three > content &&
254 + git commit -a -m three &&
255 + git fetch &&
256 + git merge origin/master || true &&
257 + echo three > content &&
258 + git commit -a --no-edit &&
259 + git push
260 + ) &&
261 +
262 + echo three > expected &&
263 + cat bzrrepo/content > actual &&
264 + test_cmp expected actual
265 '
266
267 cat > expected <<EOF
@@ -271,71 +271,71 @@ origin/trunk
271 EOF
272
273 test_expect_success 'proper bzr repo' '
274 - mkdir -p tmp && cd tmp &&
275 - test_when_finished "cd .. && rm -rf tmp" &&
276 -
277 - bzr init-repo bzrrepo &&
278 -
279 - bzr init bzrrepo/trunk &&
280 - (
281 - cd bzrrepo/trunk &&
282 - echo one >> content &&
283 - bzr add content &&
284 - bzr commit -m one
285 - ) &&
286 -
287 - bzr branch bzrrepo/trunk bzrrepo/branch &&
288 - (
289 - cd bzrrepo/branch &&
290 - echo two >> content &&
291 - bzr commit -m one
292 - ) &&
293 -
294 - git clone "bzr::$PWD/bzrrepo" gitrepo &&
295 - (
296 - cd gitrepo &&
297 - git for-each-ref --format "%(refname:short)" refs/remotes/origin > ../actual
298 - ) &&
299 -
300 - test_cmp ../expected actual
274 + mkdir -p tmp && cd tmp &&
275 + test_when_finished "cd .. && rm -rf tmp" &&
276 +
277 + bzr init-repo bzrrepo &&
278 +
279 + bzr init bzrrepo/trunk &&
280 + (
281 + cd bzrrepo/trunk &&
282 + echo one >> content &&
283 + bzr add content &&
284 + bzr commit -m one
285 + ) &&
286 +
287 + bzr branch bzrrepo/trunk bzrrepo/branch &&
288 + (
289 + cd bzrrepo/branch &&
290 + echo two >> content &&
291 + bzr commit -m one
292 + ) &&
293 +
294 + git clone "bzr::$PWD/bzrrepo" gitrepo &&
295 + (
296 + cd gitrepo &&
297 + git for-each-ref --format "%(refname:short)" refs/remotes/origin > ../actual
298 + ) &&
299 +
300 + test_cmp ../expected actual
301 '
302
303 test_expect_success 'strip' '
304 - # Do not imitate this style; always chdir inside a subshell instead
305 - mkdir -p tmp && cd tmp &&
306 - test_when_finished "cd .. && rm -rf tmp" &&
304 + # Do not imitate this style; always chdir inside a subshell instead
305 + mkdir -p tmp && cd tmp &&
306 + test_when_finished "cd .. && rm -rf tmp" &&
307
308 - (
309 - bzr init bzrrepo &&
310 - cd bzrrepo &&
308 + (
309 + bzr init bzrrepo &&
310 + cd bzrrepo &&
311
312 - echo one >> content &&
313 - bzr add content &&
314 - bzr commit -m one &&
312 + echo one >> content &&
313 + bzr add content &&
314 + bzr commit -m one &&
315
316 - echo two >> content &&
317 - bzr commit -m two
318 - ) &&
316 + echo two >> content &&
317 + bzr commit -m two
318 + ) &&
319
320 - git clone "bzr::$PWD/bzrrepo" gitrepo &&
320 + git clone "bzr::$PWD/bzrrepo" gitrepo &&
321
322 - (
323 - cd bzrrepo &&
324 - bzr uncommit --force &&
322 + (
323 + cd bzrrepo &&
324 + bzr uncommit --force &&
325
326 - echo three >> content &&
327 - bzr commit -m three &&
326 + echo three >> content &&
327 + bzr commit -m three &&
328
329 - echo four >> content &&
330 - bzr commit -m four &&
331 - bzr log --line | sed -e "s/^[0-9][0-9]*: //" > ../expected
332 - ) &&
329 + echo four >> content &&
330 + bzr commit -m four &&
331 + bzr log --line | sed -e "s/^[0-9][0-9]*: //" > ../expected
332 + ) &&
333
334 - (cd gitrepo &&
335 - git fetch &&
336 - git log --format="%an %ad %s" --date=short origin/master > ../actual) &&
334 + (cd gitrepo &&
335 + git fetch &&
336 + git log --format="%an %ad %s" --date=short origin/master > ../actual) &&
337
338 - test_cmp expected actual
338 + test_cmp expected actual
339 '
340
341 test_done
contrib/remote-helpers/test-hg.sh
+88 -88
@@ -39,119 +39,119 @@ setup () {
39 setup
40
41 test_expect_success 'cloning' '
42 - test_when_finished "rm -rf gitrepo*" &&
43 -
44 - (
45 - hg init hgrepo &&
46 - cd hgrepo &&
47 - echo zero > content &&
48 - hg add content &&
49 - hg commit -m zero
50 - ) &&
51 -
52 - git clone "hg::$PWD/hgrepo" gitrepo &&
53 - check gitrepo zero master
42 + test_when_finished "rm -rf gitrepo*" &&
43 +
44 + (
45 + hg init hgrepo &&
46 + cd hgrepo &&
47 + echo zero > content &&
48 + hg add content &&
49 + hg commit -m zero
50 + ) &&
51 +
52 + git clone "hg::$PWD/hgrepo" gitrepo &&
53 + check gitrepo zero master
54 '
55
56 test_expect_success 'cloning with branches' '
57 - test_when_finished "rm -rf gitrepo*" &&
57 + test_when_finished "rm -rf gitrepo*" &&
58
59 - (
60 - cd hgrepo &&
61 - hg branch next &&
62 - echo next > content &&
63 - hg commit -m next
64 - ) &&
59 + (
60 + cd hgrepo &&
61 + hg branch next &&
62 + echo next > content &&
63 + hg commit -m next
64 + ) &&
65
66 - git clone "hg::$PWD/hgrepo" gitrepo &&
67 - check gitrepo next next &&
66 + git clone "hg::$PWD/hgrepo" gitrepo &&
67 + check gitrepo next next &&
68
69 - (cd hgrepo && hg checkout default) &&
69 + (cd hgrepo && hg checkout default) &&
70
71 - git clone "hg::$PWD/hgrepo" gitrepo2 &&
72 - check gitrepo2 zero master
71 + git clone "hg::$PWD/hgrepo" gitrepo2 &&
72 + check gitrepo2 zero master
73 '
74
75 test_expect_success 'cloning with bookmarks' '
76 - test_when_finished "rm -rf gitrepo*" &&
77 -
78 - (
79 - cd hgrepo &&
80 - hg bookmark feature-a &&
81 - echo feature-a > content &&
82 - hg commit -m feature-a
83 - ) &&
76 + test_when_finished "rm -rf gitrepo*" &&
77
85 - git clone "hg::$PWD/hgrepo" gitrepo &&
86 - check gitrepo feature-a feature-a
78 + (
79 + cd hgrepo &&
80 + hg bookmark feature-a &&
81 + echo feature-a > content &&
82 + hg commit -m feature-a
83 + ) &&
84 +
85 + git clone "hg::$PWD/hgrepo" gitrepo &&
86 + check gitrepo feature-a feature-a
87 '
88
89 test_expect_success 'cloning with detached head' '
90 - test_when_finished "rm -rf gitrepo*" &&
90 + test_when_finished "rm -rf gitrepo*" &&
91
92 - (
93 - cd hgrepo &&
94 - hg update -r 0
95 - ) &&
92 + (
93 + cd hgrepo &&
94 + hg update -r 0
95 + ) &&
96
97 - git clone "hg::$PWD/hgrepo" gitrepo &&
98 - check gitrepo zero master
97 + git clone "hg::$PWD/hgrepo" gitrepo &&
98 + check gitrepo zero master
99 '
100
101 test_expect_success 'update bookmark' '
102 - test_when_finished "rm -rf gitrepo*" &&
103 -
104 - (
105 - cd hgrepo &&
106 - hg bookmark devel
107 - ) &&
108 -
109 - (
110 - git clone "hg::$PWD/hgrepo" gitrepo &&
111 - cd gitrepo &&
112 - git checkout --quiet devel &&
113 - echo devel > content &&
114 - git commit -a -m devel &&
115 - git push --quiet
116 - ) &&
117 -
118 - hg -R hgrepo bookmarks | egrep "devel[ ]+3:"
102 + test_when_finished "rm -rf gitrepo*" &&
103 +
104 + (
105 + cd hgrepo &&
106 + hg bookmark devel
107 + ) &&
108 +
109 + (
110 + git clone "hg::$PWD/hgrepo" gitrepo &&
111 + cd gitrepo &&
112 + git checkout --quiet devel &&
113 + echo devel > content &&
114 + git commit -a -m devel &&
115 + git push --quiet
116 + ) &&
117 +
118 + hg -R hgrepo bookmarks | egrep "devel[ ]+3:"
119 '
120
121 author_test () {
122 - echo $1 >> content &&
123 - hg commit -u "$2" -m "add $1" &&
124 - echo "$3" >> ../expected
122 + echo $1 >> content &&
123 + hg commit -u "$2" -m "add $1" &&
124 + echo "$3" >> ../expected
125 }
126
127 test_expect_success 'authors' '
128 - mkdir -p tmp && cd tmp &&
129 - test_when_finished "cd .. && rm -rf tmp" &&
130 -
131 - (
132 - hg init hgrepo &&
133 - cd hgrepo &&
134 -
135 - touch content &&
136 - hg add content &&
137 -
138 - author_test alpha "" "H G Wells <wells@example.com>" &&
139 - author_test beta "test" "test <unknown>" &&
140 - author_test beta "test <test@example.com> (comment)" "test <test@example.com>" &&
141 - author_test gamma "<test@example.com>" "Unknown <test@example.com>" &&
142 - author_test delta "name<test@example.com>" "name <test@example.com>" &&
143 - author_test epsilon "name <test@example.com" "name <test@example.com>" &&
144 - author_test zeta " test " "test <unknown>" &&
145 - author_test eta "test < test@example.com >" "test <test@example.com>" &&
146 - author_test theta "test >test@example.com>" "test <test@example.com>" &&
147 - author_test iota "test < test <at> example <dot> com>" "test <unknown>" &&
148 - author_test kappa "test@example.com" "Unknown <test@example.com>"
149 - ) &&
150 -
151 - git clone "hg::$PWD/hgrepo" gitrepo &&
152 - git --git-dir=gitrepo/.git log --reverse --format="%an <%ae>" > actual &&
153 -
154 - test_cmp expected actual
128 + mkdir -p tmp && cd tmp &&
129 + test_when_finished "cd .. && rm -rf tmp" &&
130 +
131 + (
132 + hg init hgrepo &&
133 + cd hgrepo &&
134 +
135 + touch content &&
136 + hg add content &&
137 +
138 + author_test alpha "" "H G Wells <wells@example.com>" &&
139 + author_test beta "test" "test <unknown>" &&
140 + author_test beta "test <test@example.com> (comment)" "test <test@example.com>" &&
141 + author_test gamma "<test@example.com>" "Unknown <test@example.com>" &&
142 + author_test delta "name<test@example.com>" "name <test@example.com>" &&
143 + author_test epsilon "name <test@example.com" "name <test@example.com>" &&
144 + author_test zeta " test " "test <unknown>" &&
145 + author_test eta "test < test@example.com >" "test <test@example.com>" &&
146 + author_test theta "test >test@example.com>" "test <test@example.com>" &&
147 + author_test iota "test < test <at> example <dot> com>" "test <unknown>" &&
148 + author_test kappa "test@example.com" "Unknown <test@example.com>"
149 + ) &&
150 +
151 + git clone "hg::$PWD/hgrepo" gitrepo &&
152 + git --git-dir=gitrepo/.git log --reverse --format="%an <%ae>" > actual &&
153 +
154 + test_cmp expected actual
155 '
156
157 test_done