3 # Copyright (c) 2007 Eric Wong
6 test_description
='git svn dcommit can commit renames of files with ugly names'
8 TEST_FAILS_SANITIZE_LEAK
=true
11 test_expect_success
'load repository with strange names' '
12 svnadmin load -q "$rawsvnrepo" <"$TEST_DIRECTORY"/t9115/funky-names.dump
15 maybe_start_httpd gtk
+
17 test_expect_success
'init and fetch repository' '
18 git svn init "$svnrepo" &&
20 git reset --hard git-svn
23 test_expect_success
'create file in existing ugly and empty dir' '
24 mkdir -p "#{bad_directory_name}" &&
25 echo hi > "#{bad_directory_name}/ foo" &&
26 git update-index --add "#{bad_directory_name}/ foo" &&
27 git commit -m "new file in ugly parent" &&
31 test_expect_success
'rename ugly file' '
32 git mv "#{bad_directory_name}/ foo" "file name with feces" &&
33 git commit -m "rename ugly file" &&
37 test_expect_success
'rename pretty file' '
39 git update-index --add pretty &&
40 git commit -m "pretty :x" &&
42 mkdir -p regular_dir_name &&
43 git mv pretty regular_dir_name/pretty &&
44 git commit -m "moved pretty file" &&
48 test_expect_success
'rename pretty file into ugly one' '
49 git mv regular_dir_name/pretty "#{bad_directory_name}/ booboo" &&
50 git commit -m booboo &&
54 test_expect_success
'add a file with plus signs' '
56 git update-index --add +_+ &&
59 git mv +_+ gtk+/_+_ &&
60 git commit -m plus_dir &&
64 test_expect_success
'clone the repository to test rebase' '
65 git svn clone "$svnrepo" test-rebase &&
68 echo test-rebase >test-rebase &&
69 git add test-rebase &&
70 git commit -m test-rebase
74 test_expect_success
'make a commit to test rebase' '
75 echo test-rebase-main > test-rebase-main &&
76 git add test-rebase-main &&
77 git commit -m test-rebase-main &&
81 test_expect_success
'git svn rebase works inside a fresh-cloned repository' '
85 test -e test-rebase-main &&
89 # Without this, LC_ALL=C as set in test-lib.sh, and Cygwin converts
90 # non-ASCII characters in filenames unexpectedly, and causes errors.
91 # https://cygwin.com/cygwin-ug-net/using-specialnames.html#pathnames-specialchars
92 # > Some characters are disallowed in filenames on Windows filesystems. ...
94 # > ... All of the above characters, except for the backslash, are converted
95 # > to special UNICODE characters in the range 0xf000 to 0xf0ff (the
96 # > "Private use area") when creating or accessing files.
98 test_expect_success UTF8
,!MINGW
,!UTF8_NFD_TO_NFC
'svn.pathnameencoding=cp932 new file on dcommit' '
99 LC_ALL=$GIT_TEST_UTF8_LOCALE &&
101 neq=$(printf "\201\202") &&
102 git config svn.pathnameencoding cp932 &&
105 git commit -m "neq" &&
109 # See the comment on the above test for setting of LC_ALL.
110 test_expect_success
!MINGW
,!UTF8_NFD_TO_NFC
'svn.pathnameencoding=cp932 rename on dcommit' '
111 LC_ALL=$GIT_TEST_UTF8_LOCALE &&
113 inf=$(printf "\201\207") &&
114 git config svn.pathnameencoding cp932 &&
117 git commit -m "inf" &&
120 git commit -m "inf rename" &&