]> git.ipfire.org Git - thirdparty/git.git/blame - t/t9115-git-svn-dcommit-funky-renames.sh
Merge branch 'sg/progress-fix'
[thirdparty/git.git] / t / t9115-git-svn-dcommit-funky-renames.sh
CommitLineData
29633bb9
EW
1#!/bin/sh
2#
3# Copyright (c) 2007 Eric Wong
4
5
1364ff27 6test_description='git svn dcommit can commit renames of files with ugly names'
29633bb9
EW
7
8. ./lib-git-svn.sh
9
f69e836f 10test_expect_success 'load repository with strange names' '
a8a5d251
EW
11 svnadmin load -q "$rawsvnrepo" <"$TEST_DIRECTORY"/t9115/funky-names.dump
12'
13
14maybe_start_httpd gtk+
29633bb9 15
f69e836f
BD
16test_expect_success 'init and fetch repository' '
17 git svn init "$svnrepo" &&
29633bb9
EW
18 git svn fetch &&
19 git reset --hard git-svn
f69e836f 20 '
29633bb9
EW
21
22test_expect_success 'create file in existing ugly and empty dir' '
6111b934 23 mkdir -p "#{bad_directory_name}" &&
29633bb9
EW
24 echo hi > "#{bad_directory_name}/ foo" &&
25 git update-index --add "#{bad_directory_name}/ foo" &&
26 git commit -m "new file in ugly parent" &&
27 git svn dcommit
28 '
29
30test_expect_success 'rename ugly file' '
31 git mv "#{bad_directory_name}/ foo" "file name with feces" &&
32 git commit -m "rename ugly file" &&
33 git svn dcommit
34 '
35
36test_expect_success 'rename pretty file' '
37 echo :x > pretty &&
38 git update-index --add pretty &&
39 git commit -m "pretty :x" &&
40 git svn dcommit &&
6111b934 41 mkdir -p regular_dir_name &&
29633bb9
EW
42 git mv pretty regular_dir_name/pretty &&
43 git commit -m "moved pretty file" &&
44 git svn dcommit
45 '
46
47test_expect_success 'rename pretty file into ugly one' '
48 git mv regular_dir_name/pretty "#{bad_directory_name}/ booboo" &&
49 git commit -m booboo &&
50 git svn dcommit
51 '
52
d1a8d0ea
EW
53test_expect_success 'add a file with plus signs' '
54 echo .. > +_+ &&
55 git update-index --add +_+ &&
56 git commit -m plus &&
57 mkdir gtk+ &&
58 git mv +_+ gtk+/_+_ &&
59 git commit -m plus_dir &&
60 git svn dcommit
61 '
62
761adeb4
JH
63test_expect_success 'clone the repository to test rebase' '
64 git svn clone "$svnrepo" test-rebase &&
18a82692
JN
65 (
66 cd test-rebase &&
67 echo test-rebase >test-rebase &&
d1a8d0ea 68 git add test-rebase &&
fd4ec4f2 69 git commit -m test-rebase
18a82692 70 )
761adeb4 71 '
d1a8d0ea 72
761adeb4 73test_expect_success 'make a commit to test rebase' '
d1a8d0ea
EW
74 echo test-rebase-main > test-rebase-main &&
75 git add test-rebase-main &&
76 git commit -m test-rebase-main &&
77 git svn dcommit
761adeb4 78 '
d1a8d0ea 79
1364ff27 80test_expect_success 'git svn rebase works inside a fresh-cloned repository' '
40f47448
KS
81 (
82 cd test-rebase &&
d1a8d0ea
EW
83 git svn rebase &&
84 test -e test-rebase-main &&
85 test -e test-rebase
40f47448
KS
86 )'
87
88# Without this, LC_ALL=C as set in test-lib.sh, and Cygwin converts
89# non-ASCII characters in filenames unexpectedly, and causes errors.
90# https://cygwin.com/cygwin-ug-net/using-specialnames.html#pathnames-specialchars
91# > Some characters are disallowed in filenames on Windows filesystems. ...
92# ...
93# > ... All of the above characters, except for the backslash, are converted
94# > to special UNICODE characters in the range 0xf000 to 0xf0ff (the
95# > "Private use area") when creating or accessing files.
96prepare_a_utf8_locale
8257d3b4 97test_expect_success UTF8,!MINGW,!UTF8_NFD_TO_NFC 'svn.pathnameencoding=cp932 new file on dcommit' '
40f47448
KS
98 LC_ALL=$a_utf8_locale &&
99 export LC_ALL &&
100 neq=$(printf "\201\202") &&
101 git config svn.pathnameencoding cp932 &&
102 echo neq >"$neq" &&
103 git add "$neq" &&
104 git commit -m "neq" &&
105 git svn dcommit
106'
d1a8d0ea 107
1b42f452 108# See the comment on the above test for setting of LC_ALL.
8257d3b4 109test_expect_success !MINGW,!UTF8_NFD_TO_NFC 'svn.pathnameencoding=cp932 rename on dcommit' '
1b42f452
KS
110 LC_ALL=$a_utf8_locale &&
111 export LC_ALL &&
112 inf=$(printf "\201\207") &&
113 git config svn.pathnameencoding cp932 &&
114 echo inf >"$inf" &&
115 git add "$inf" &&
116 git commit -m "inf" &&
117 git svn dcommit &&
118 git mv "$inf" inf &&
119 git commit -m "inf rename" &&
120 git svn dcommit
121'
122
29633bb9 123test_done