Skip to content

Commit 924f6c3

Browse files
tboegigitster
authored andcommitted
test-bzr: portable shell and utf-8 strings for Mac OS
Make the shell script more portable: - Split export X=Y into 2 lines - Use printf instead of echo -e Use UTF-8 code points which are not decomposed by the filesystem: Code points like "á" will be decomposed by Mac OS X. bzr is unable to find the file "á" on disk. Use code points from unicode which can not be decomposed. In other words, the precompsed form use the same bytes as decomposed. Signed-off-by: Torsten Bögershausen <[email protected]> Acked-by: Felipe Contreras <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent caa7d79 commit 924f6c3

File tree

1 file changed

+19
-19
lines changed

1 file changed

+19
-19
lines changed

contrib/remote-helpers/test-bzr.sh

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -169,39 +169,39 @@ test_expect_success 'fetch utf-8 filenames' '
169169
mkdir -p tmp && cd tmp &&
170170
test_when_finished "cd .. && rm -rf tmp && LC_ALL=C" &&
171171
172-
export LC_ALL=en_US.UTF-8
173-
172+
LC_ALL=en_US.UTF-8
173+
export LC_ALL
174174
(
175175
bzr init bzrrepo &&
176176
cd bzrrepo &&
177177
178-
echo test >> "áéíóú" &&
179-
bzr add "áéíóú" &&
180-
echo test >> "îø∫∆" &&
181-
bzr add "îø∫∆" &&
182-
bzr commit -m utf-8 &&
183-
echo test >> "áéíóú" &&
184-
bzr commit -m utf-8 &&
185-
bzr rm "îø∫∆" &&
186-
bzr mv "áéíóú" "åß∂" &&
187-
bzr commit -m utf-8
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
188188
) &&
189189
190190
(
191191
git clone "bzr::$PWD/bzrrepo" gitrepo &&
192192
cd gitrepo &&
193-
git ls-files > ../actual
193+
git -c core.quotepath=false ls-files > ../actual
194194
) &&
195-
196-
echo "\"\\303\\245\\303\\237\\342\\210\\202\"" > expected &&
195+
echo "ø~?" > expected &&
197196
test_cmp expected actual
198197
'
199198

200199
test_expect_success 'push utf-8 filenames' '
201200
mkdir -p tmp && cd tmp &&
202201
test_when_finished "cd .. && rm -rf tmp && LC_ALL=C" &&
203202
204-
export LC_ALL=en_US.UTF-8
203+
LC_ALL=en_US.UTF-8
204+
export LC_ALL
205205
206206
(
207207
bzr init bzrrepo &&
@@ -216,15 +216,15 @@ test_expect_success 'push utf-8 filenames' '
216216
git clone "bzr::$PWD/bzrrepo" gitrepo &&
217217
cd gitrepo &&
218218
219-
echo test >> "áéíóú" &&
220-
git add "áéíóú" &&
219+
echo test >> "ærø" &&
220+
git add "ærø" &&
221221
git commit -m utf-8 &&
222222
223223
git push
224224
) &&
225225
226226
(cd bzrrepo && bzr ls > ../actual) &&
227-
echo -e "content\náéíóú" > expected &&
227+
printf "content\nærø\n" > expected &&
228228
test_cmp expected actual
229229
'
230230

0 commit comments

Comments
 (0)