Skip to content
Navigation Menu
Toggle navigation
Sign in
In this repository
All GitHub Enterprise
↵
Jump to
↵
No suggested jump to results
In this repository
All GitHub Enterprise
↵
Jump to
↵
In this organization
All GitHub Enterprise
↵
Jump to
↵
In this repository
All GitHub Enterprise
↵
Jump to
↵
Sign in
Reseting focus
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
git-mirror
/
git
Public
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Issues
0
Pull requests
0
Actions
Projects
0
Security
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security
Insights
Files
462d97d
Documentation
block-sha1
builtin
compat
contrib
blameview
buildsystems
ciabot
completion
continuous
convert-objects
credential
diff-highlight
diffall
emacs
examples
fast-import
git-jump
git-shell-commands
gitview
hg-to-git
hooks
mw-to-git
t
install-wiki
.gitignore
Makefile
README
install-wiki.sh
push-pull-tests.sh
t9360-mw-to-git-clone.sh
t9361-mw-to-git-push-pull.sh
t9362-mw-to-git-utf8.sh
t9363-mw-to-git-export-import.sh
t9364-pull-by-rev.sh
test-gitmw-lib.sh
test-gitmw.pl
test.config
Makefile
git-remote-mediawiki
git-remote-mediawiki.txt
p4import
patches
persistent-https
stats
subtree
svn-fe
thunderbird-patch-inline
vim
workdir
README
git-resurrect.sh
remotes2config.sh
rerere-train.sh
git-gui
git_remote_helpers
gitk-git
gitweb
mergetools
perl
po
ppc
t
templates
vcs-svn
xdiff
.gitattributes
.gitignore
.mailmap
COPYING
GIT-VERSION-GEN
INSTALL
LGPL-2.1
Makefile
README
RelNotes
abspath.c
aclocal.m4
advice.c
advice.h
alias.c
alloc.c
archive-tar.c
archive-zip.c
archive.c
archive.h
argv-array.c
argv-array.h
attr.c
attr.h
base85.c
bisect.c
bisect.h
blob.c
blob.h
branch.c
branch.h
builtin.h
bulk-checkin.c
bulk-checkin.h
bundle.c
bundle.h
cache-tree.c
cache-tree.h
cache.h
check-builtins.sh
check-racy.c
check_bindir
color.c
color.h
column.c
column.h
combine-diff.c
command-list.txt
commit.c
commit.h
config.c
config.mak.in
configure.ac
connect.c
connected.c
connected.h
convert.c
convert.h
copy.c
credential-cache--daemon.c
credential-cache.c
credential-store.c
credential.c
credential.h
csum-file.c
csum-file.h
ctype.c
daemon.c
date.c
decorate.c
decorate.h
delta.h
diff-delta.c
diff-lib.c
diff-no-index.c
diff.c
diff.h
diffcore-break.c
diffcore-delta.c
diffcore-order.c
diffcore-pickaxe.c
diffcore-rename.c
diffcore.h
dir.c
dir.h
editor.c
entry.c
environment.c
exec_cmd.c
exec_cmd.h
fast-import.c
fetch-pack.h
fixup-builtins
fmt-merge-msg.h
fsck.c
fsck.h
generate-cmdlist.sh
gettext.c
gettext.h
git-add--interactive.perl
git-am.sh
git-archimport.perl
git-bisect.sh
git-compat-util.h
git-cvsexportcommit.perl
git-cvsimport.perl
git-cvsserver.perl
git-difftool--helper.sh
git-difftool.perl
git-filter-branch.sh
git-instaweb.sh
git-lost-found.sh
git-merge-octopus.sh
git-merge-one-file.sh
git-merge-resolve.sh
git-mergetool--lib.sh
git-mergetool.sh
git-p4.py
git-parse-remote.sh
git-pull.sh
git-quiltimport.sh
git-rebase--am.sh
git-rebase--interactive.sh
git-rebase--merge.sh
git-rebase.sh
git-relink.perl
git-remote-testgit.py
git-repack.sh
git-request-pull.sh
git-send-email.perl
git-sh-i18n.sh
git-sh-setup.sh
git-stash.sh
git-submodule.sh
git-svn.perl
git-web--browse.sh
git.c
git.spec.in
gpg-interface.c
gpg-interface.h
graph.c
graph.h
grep.c
grep.h
hash.c
hash.h
help.c
help.h
hex.c
http-backend.c
http-fetch.c
http-push.c
http-walker.c
http.c
http.h
ident.c
imap-send.c
kwset.c
kwset.h
levenshtein.c
levenshtein.h
list-objects.c
list-objects.h
ll-merge.c
ll-merge.h
lockfile.c
log-tree.c
log-tree.h
mailmap.c
mailmap.h
match-trees.c
merge-file.c
merge-file.h
merge-recursive.c
merge-recursive.h
mergesort.c
mergesort.h
name-hash.c
notes-cache.c
notes-cache.h
notes-merge.c
notes-merge.h
notes.c
notes.h
object.c
object.h
pack-check.c
pack-refs.c
pack-refs.h
pack-revindex.c
pack-revindex.h
pack-write.c
pack.h
pager.c
parse-options-cb.c
parse-options.c
parse-options.h
patch-delta.c
patch-ids.c
patch-ids.h
path.c
pkt-line.c
pkt-line.h
preload-index.c
pretty.c
progress.c
progress.h
prompt.c
prompt.h
quote.c
quote.h
reachable.c
reachable.h
read-cache.c
reflog-walk.c
reflog-walk.h
refs.c
refs.h
remote-curl.c
remote.c
remote.h
replace_object.c
rerere.c
rerere.h
resolve-undo.c
resolve-undo.h
revision.c
revision.h
run-command.c
run-command.h
send-pack.h
sequencer.c
sequencer.h
server-info.c
setup.c
sh-i18n--envsubst.c
sha1-array.c
sha1-array.h
sha1-lookup.c
sha1-lookup.h
sha1_file.c
sha1_name.c
shallow.c
shell.c
shortlog.h
show-index.c
sideband.c
sideband.h
sigchain.c
sigchain.h
strbuf.c
strbuf.h
streaming.c
streaming.h
string-list.c
string-list.h
submodule.c
submodule.h
symlinks.c
tag.c
tag.h
tar.h
test-chmtime.c
test-ctype.c
test-date.c
test-delta.c
test-dump-cache-tree.c
test-genrandom.c
test-index-version.c
test-line-buffer.c
test-match-trees.c
test-mergesort.c
test-mktemp.c
test-parse-options.c
test-path-utils.c
test-regex.c
test-revision-walking.c
test-run-command.c
test-scrap-cache-tree.c
test-sha1.c
test-sha1.sh
test-sigchain.c
test-string-list.c
test-subprocess.c
test-svn-fe.c
thread-utils.c
thread-utils.h
trace.c
transport-helper.c
transport.c
transport.h
tree-diff.c
tree-walk.c
tree-walk.h
tree.c
tree.h
unimplemented.sh
unix-socket.c
unix-socket.h
unpack-trees.c
unpack-trees.h
upload-pack.c
url.c
url.h
usage.c
userdiff.c
userdiff.h
utf8.c
utf8.h
varint.c
varint.h
version.c
version.h
walker.c
walker.h
wrap-for-bin.sh
wrapper.c
write_or_die.c
ws.c
wt-status.c
wt-status.h
xdiff-interface.c
xdiff-interface.h
zlib.c
Breadcrumbs
git
/
contrib
/
mw-to-git
/
t
/
t9362-mw-to-git-utf8.sh
Blame
Blame
Latest commit
History
History
executable file
·
347 lines (294 loc) · 9.64 KB
Breadcrumbs
git
/
contrib
/
mw-to-git
/
t
/
t9362-mw-to-git-utf8.sh
Top
File metadata and controls
Code
Blame
executable file
·
347 lines (294 loc) · 9.64 KB
Raw
#!/bin/sh # # Copyright (C) 2012 # Charles Roussel <charles.roussel@ensimag.imag.fr> # Simon Cathebras <simon.cathebras@ensimag.imag.fr> # Julien Khayat <julien.khayat@ensimag.imag.fr> # Guillaume Sasdy <guillaume.sasdy@ensimag.imag.fr> # Simon Perrat <simon.perrat@ensimag.imag.fr> # # License: GPL v2 or later # tests for git-remote-mediawiki test_description='Test git-mediawiki with special characters in filenames' . ./test-gitmw-lib.sh . $TEST_DIRECTORY/test-lib.sh test_check_precond test_expect_success 'Git clone works for a wiki with accents in the page names' ' wiki_reset && wiki_editpage féé "This page must be délétéd before clone" false && wiki_editpage kèè "This page must be deleted before clone" false && wiki_editpage hàà "This page must be deleted before clone" false && wiki_editpage kîî "This page must be deleted before clone" false && wiki_editpage foo "This page must be deleted before clone" false && git clone mediawiki::'"$WIKI_URL"' mw_dir_1 && wiki_getallpage ref_page_1 && test_diff_directories mw_dir_1 ref_page_1 ' test_expect_success 'Git pull works with a wiki with accents in the pages names' ' wiki_reset && wiki_editpage kîî "this page must be cloned" false && wiki_editpage foo "this page must be cloned" false && git clone mediawiki::'"$WIKI_URL"' mw_dir_2 && wiki_editpage éàîôû "This page must be pulled" false && ( cd mw_dir_2 && git pull ) && wiki_getallpage ref_page_2 && test_diff_directories mw_dir_2 ref_page_2 ' test_expect_success 'Cloning a chosen page works with accents' ' wiki_reset && wiki_editpage kîî "this page must be cloned" false && git clone -c remote.origin.pages=kîî \ mediawiki::'"$WIKI_URL"' mw_dir_3 && wiki_check_content mw_dir_3/Kîî.mw Kîî && test_path_is_file mw_dir_3/Kîî.mw && rm -rf mw_dir_3 ' test_expect_success 'The shallow option works with accents' ' wiki_reset && wiki_editpage néoà "1st revision, should not be cloned" false && wiki_editpage néoà "2nd revision, should be cloned" false && git -c remote.origin.shallow=true clone \ mediawiki::'"$WIKI_URL"' mw_dir_4 && test_contains_N_files mw_dir_4 2 && test_path_is_file mw_dir_4/Néoà.mw && test_path_is_file mw_dir_4/Main_Page.mw && ( cd mw_dir_4 && test `git log --oneline Néoà.mw | wc -l` -eq 1 && test `git log --oneline Main_Page.mw | wc -l ` -eq 1 ) && wiki_check_content mw_dir_4/Néoà.mw Néoà && wiki_check_content mw_dir_4/Main_Page.mw Main_Page ' test_expect_success 'Cloning works when page name first letter has an accent' ' wiki_reset && wiki_editpage îî "this page must be cloned" false && git clone -c remote.origin.pages=îî \ mediawiki::'"$WIKI_URL"' mw_dir_5 && test_path_is_file mw_dir_5/Îî.mw && wiki_check_content mw_dir_5/Îî.mw Îî ' test_expect_success 'Git push works with a wiki with accents' ' wiki_reset && wiki_editpage féé "lots of accents : éèàÖ" false && wiki_editpage foo "this page must be cloned" false && git clone mediawiki::'"$WIKI_URL"' mw_dir_6 && ( cd mw_dir_6 && echo "A wild Pîkächû appears on the wiki" >Pîkächû.mw && git add Pîkächû.mw && git commit -m "A new page appears" && git push ) && wiki_getallpage ref_page_6 && test_diff_directories mw_dir_6 ref_page_6 ' test_expect_success 'Git clone works with accentsand spaces' ' wiki_reset && wiki_editpage "é à î" "this page must be délété before the clone" false && git clone mediawiki::'"$WIKI_URL"' mw_dir_7 && wiki_getallpage ref_page_7 && test_diff_directories mw_dir_7 ref_page_7 ' test_expect_success 'character $ in page name (mw -> git)' ' wiki_reset && wiki_editpage file_\$_foo "expect to be called file_$_foo" false && git clone mediawiki::'"$WIKI_URL"' mw_dir_8 && test_path_is_file mw_dir_8/File_\$_foo.mw && wiki_getallpage ref_page_8 && test_diff_directories mw_dir_8 ref_page_8 ' test_expect_success 'character $ in file name (git -> mw) ' ' wiki_reset && git clone mediawiki::'"$WIKI_URL"' mw_dir_9 && ( cd mw_dir_9 && echo "this file is called File_\$_foo.mw" >File_\$_foo.mw && git add . && git commit -am "file File_\$_foo.mw" && git pull && git push ) && wiki_getallpage ref_page_9 && test_diff_directories mw_dir_9 ref_page_9 ' test_expect_failure 'capital at the begining of file names' ' wiki_reset && git clone mediawiki::'"$WIKI_URL"' mw_dir_10 && ( cd mw_dir_10 && echo "my new file foo" >foo.mw && echo "my new file Foo... Finger crossed" >Foo.mw && git add . && git commit -am "file foo.mw" && git pull && git push ) && wiki_getallpage ref_page_10 && test_diff_directories mw_dir_10 ref_page_10 ' test_expect_failure 'special character at the begining of file name from mw to git' ' wiki_reset && git clone mediawiki::'"$WIKI_URL"' mw_dir_11 && wiki_editpage {char_1 "expect to be renamed {char_1" false && wiki_editpage [char_2 "expect to be renamed [char_2" false && ( cd mw_dir_11 && git pull ) && test_path_is_file mw_dir_11/{char_1 && test_path_is_file mw_dir_11/[char_2 ' test_expect_success 'Pull page with title containing ":" other than namespace separator' ' wiki_editpage Foo:Bar content false && ( cd mw_dir_11 && git pull ) && test_path_is_file mw_dir_11/Foo:Bar.mw ' test_expect_success 'Push page with title containing ":" other than namespace separator' ' ( cd mw_dir_11 && echo content >NotANameSpace:Page.mw && git add NotANameSpace:Page.mw && git commit -m "add page with colon" && git push ) && wiki_page_exist NotANameSpace:Page ' test_expect_success 'test of correct formating for file name from mw to git' ' wiki_reset && git clone mediawiki::'"$WIKI_URL"' mw_dir_12 && wiki_editpage char_%_7b_1 "expect to be renamed char{_1" false && wiki_editpage char_%_5b_2 "expect to be renamed char{_2" false && ( cd mw_dir_12 && git pull ) && test_path_is_file mw_dir_12/Char\{_1.mw && test_path_is_file mw_dir_12/Char\[_2.mw && wiki_getallpage ref_page_12 && mv ref_page_12/Char_%_7b_1.mw ref_page_12/Char\{_1.mw && mv ref_page_12/Char_%_5b_2.mw ref_page_12/Char\[_2.mw && test_diff_directories mw_dir_12 ref_page_12 ' test_expect_failure 'test of correct formating for file name begining with special character' ' wiki_reset && git clone mediawiki::'"$WIKI_URL"' mw_dir_13 && ( cd mw_dir_13 && echo "my new file {char_1" >\{char_1.mw && echo "my new file [char_2" >\[char_2.mw && git add . && git commit -am "commiting some exotic file name..." && git push && git pull ) && wiki_getallpage ref_page_13 && test_path_is_file ref_page_13/{char_1.mw && test_path_is_file ref_page_13/[char_2.mw && test_diff_directories mw_dir_13 ref_page_13 ' test_expect_success 'test of correct formating for file name from git to mw' ' wiki_reset && git clone mediawiki::'"$WIKI_URL"' mw_dir_14 && ( cd mw_dir_14 && echo "my new file char{_1" >Char\{_1.mw && echo "my new file char[_2" >Char\[_2.mw && git add . && git commit -m "commiting some exotic file name..." && git push ) && wiki_getallpage ref_page_14 && mv mw_dir_14/Char\{_1.mw mw_dir_14/Char_%_7b_1.mw && mv mw_dir_14/Char\[_2.mw mw_dir_14/Char_%_5b_2.mw && test_diff_directories mw_dir_14 ref_page_14 ' test_expect_success 'git clone with /' ' wiki_reset && wiki_editpage \/fo\/o "this is not important" false -c=Deleted && git clone mediawiki::'"$WIKI_URL"' mw_dir_15 && test_path_is_file mw_dir_15/%2Ffo%2Fo.mw && wiki_check_content mw_dir_15/%2Ffo%2Fo.mw \/fo\/o ' test_expect_success 'git push with /' ' wiki_reset && git clone mediawiki::'"$WIKI_URL"' mw_dir_16 && echo "I will be on the wiki" >mw_dir_16/%2Ffo%2Fo.mw && ( cd mw_dir_16 && git add %2Ffo%2Fo.mw && git commit -m " %2Ffo%2Fo added" && git push ) && wiki_page_exist \/fo\/o && wiki_check_content mw_dir_16/%2Ffo%2Fo.mw \/fo\/o ' test_expect_success 'git clone with \' ' wiki_reset && wiki_editpage \\ko\\o "this is not important" false -c=Deleted && git clone mediawiki::'"$WIKI_URL"' mw_dir_17 && test_path_is_file mw_dir_17/\\ko\\o.mw && wiki_check_content mw_dir_17/\\ko\\o.mw \\ko\\o ' test_expect_success 'git push with \' ' wiki_reset && git clone mediawiki::'"$WIKI_URL"' mw_dir_18 && echo "I will be on the wiki" >mw_dir_18/\\ko\\o.mw && ( cd mw_dir_18 && git add \\ko\\o.mw && git commit -m " \\ko\\o added" && git push )&& wiki_page_exist \\ko\\o && wiki_check_content mw_dir_18/\\ko\\o.mw \\ko\\o ' test_expect_success 'git clone with \ in format control' ' wiki_reset && wiki_editpage \\no\\o "this is not important" false && git clone mediawiki::'"$WIKI_URL"' mw_dir_19 && test_path_is_file mw_dir_19/\\no\\o.mw && wiki_check_content mw_dir_19/\\no\\o.mw \\no\\o ' test_expect_success 'git push with \ in format control' ' wiki_reset && git clone mediawiki::'"$WIKI_URL"' mw_dir_20 && echo "I will be on the wiki" >mw_dir_20/\\fo\\o.mw && ( cd mw_dir_20 && git add \\fo\\o.mw && git commit -m " \\fo\\o added" && git push )&& wiki_page_exist \\fo\\o && wiki_check_content mw_dir_20/\\fo\\o.mw \\fo\\o ' test_expect_success 'fast-import meta-characters in page name (mw -> git)' ' wiki_reset && wiki_editpage \"file\"_\\_foo "expect to be called \"file\"_\\_foo" false && git clone mediawiki::'"$WIKI_URL"' mw_dir_21 && test_path_is_file mw_dir_21/\"file\"_\\_foo.mw && wiki_getallpage ref_page_21 && test_diff_directories mw_dir_21 ref_page_21 ' test_expect_success 'fast-import meta-characters in page name (git -> mw) ' ' wiki_reset && git clone mediawiki::'"$WIKI_URL"' mw_dir_22 && ( cd mw_dir_22 && echo "this file is called \"file\"_\\_foo.mw" >\"file\"_\\_foo && git add . && git commit -am "file \"file\"_\\_foo" && git pull && git push ) && wiki_getallpage ref_page_22 && test_diff_directories mw_dir_22 ref_page_22 ' test_done
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
You can’t perform that action at this time.