Skip to content

Commit 8d784da

Browse files
felipecgitster
authored andcommitted
remote-hg: add tests for special filenames
So that we check that UTF-8 and spaces work fine. Signed-off-by: Felipe Contreras <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent e71d137 commit 8d784da

File tree

1 file changed

+68
-0
lines changed

1 file changed

+68
-0
lines changed

contrib/remote-helpers/test-hg.sh

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -444,6 +444,74 @@ test_expect_success 'remote new bookmark multiple branch head' '
444444
# cleanup previous stuff
445445
rm -rf hgrepo
446446

447+
test_expect_success 'fetch special filenames' '
448+
test_when_finished "rm -rf hgrepo gitrepo && LC_ALL=C" &&
449+
450+
LC_ALL=en_US.UTF-8
451+
export LC_ALL
452+
453+
(
454+
hg init hgrepo &&
455+
cd hgrepo &&
456+
457+
echo test >> "æ rø" &&
458+
hg add "æ rø" &&
459+
echo test >> "ø~?" &&
460+
hg add "ø~?" &&
461+
hg commit -m add-utf-8 &&
462+
echo test >> "æ rø" &&
463+
hg commit -m test-utf-8 &&
464+
hg rm "ø~?" &&
465+
hg mv "æ rø" "ø~?" &&
466+
hg commit -m hg-mv-utf-8
467+
) &&
468+
469+
(
470+
git clone "hg::hgrepo" gitrepo &&
471+
cd gitrepo &&
472+
git -c core.quotepath=false ls-files > ../actual
473+
) &&
474+
echo "ø~?" > expected &&
475+
test_cmp expected actual
476+
'
477+
478+
test_expect_success 'push special filenames' '
479+
test_when_finished "rm -rf hgrepo gitrepo && LC_ALL=C" &&
480+
481+
mkdir -p tmp && cd tmp &&
482+
483+
LC_ALL=en_US.UTF-8
484+
export LC_ALL
485+
486+
(
487+
hg init hgrepo &&
488+
cd hgrepo &&
489+
490+
echo one >> content &&
491+
hg add content &&
492+
hg commit -m one
493+
) &&
494+
495+
(
496+
git clone "hg::hgrepo" gitrepo &&
497+
cd gitrepo &&
498+
499+
echo test >> "æ rø" &&
500+
git add "æ rø" &&
501+
git commit -m utf-8 &&
502+
503+
git push
504+
) &&
505+
506+
(cd hgrepo &&
507+
hg update &&
508+
hg manifest > ../actual
509+
) &&
510+
511+
printf "content\næ rø\n" > expected &&
512+
test_cmp expected actual
513+
'
514+
447515
setup_big_push () {
448516
(
449517
hg init hgrepo &&

0 commit comments

Comments
 (0)