Skip to content

Commit f51bb67

Browse files
nallanalla
authored andcommitted
mingw: Fix git-svn tests
There are some issues with the git-svn test cases when they are being run on windows under a MINGW build. Some things are not available like the changing of the execute flag of shell scripts via the chmod command. Also there were problems with folder names that end with a dot on windows. Signed-off-by: 마누엘 <[email protected]>
1 parent 6b7736b commit f51bb67

File tree

4 files changed

+41
-17
lines changed

4 files changed

+41
-17
lines changed

t/t9100-git-svn-basic.sh

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,10 @@ test_expect_success \
3131
mkdir bar &&
3232
echo "zzz" >bar/zzz &&
3333
echo "#!/bin/sh" >exec.sh &&
34-
chmod +x exec.sh &&
34+
{
35+
test_have_prereq !POSIXPERM ||
36+
chmod +x exec.sh
37+
} &&
3538
svn_cmd import -m "import for git svn" . "$svnrepo" >/dev/null
3639
) &&
3740
rm -rf import &&
@@ -117,7 +120,7 @@ test_expect_success "$name" '
117120

118121

119122
name='remove executable bit from a file'
120-
test_expect_success "$name" '
123+
test_expect_success !MINGW "$name" '
121124
rm -f "$GIT_DIR"/index &&
122125
git checkout -f -b mybranch5 ${remotes_git_svn} &&
123126
chmod -x exec.sh &&
@@ -130,7 +133,7 @@ test_expect_success "$name" '
130133

131134

132135
name='add executable bit back file'
133-
test_expect_success "$name" '
136+
test_expect_success !MINGW "$name" '
134137
chmod +x exec.sh &&
135138
git update-index exec.sh &&
136139
git commit -m "$name" &&
@@ -141,7 +144,7 @@ test_expect_success "$name" '
141144

142145

143146
name='executable file becomes a symlink to file'
144-
test_expect_success "$name" '
147+
test_expect_success !MINGW "$name" '
145148
rm exec.sh &&
146149
ln -s file exec.sh &&
147150
git update-index exec.sh &&
@@ -153,8 +156,11 @@ test_expect_success "$name" '
153156

154157
name='new symlink is added to a file that was also just made executable'
155158

156-
test_expect_success "$name" '
157-
chmod +x file &&
159+
test_expect_success !MINGW "$name" '
160+
{
161+
test_have_prereq !POSIXPERM ||
162+
chmod +x file
163+
} &&
158164
ln -s file exec-2.sh &&
159165
git update-index --add file exec-2.sh &&
160166
git commit -m "$name" &&
@@ -165,7 +171,7 @@ test_expect_success "$name" '
165171
test -h "$SVN_TREE"/exec-2.sh'
166172

167173
name='modify a symlink to become a file'
168-
test_expect_success "$name" '
174+
test_expect_success !MINGW "$name" '
169175
echo git help >help &&
170176
rm exec-2.sh &&
171177
cp help exec-2.sh &&
@@ -181,7 +187,7 @@ test_expect_success "$name" '
181187
name="commit with UTF-8 message: locale: $GIT_SVN_LC_ALL"
182188
LC_ALL="$GIT_SVN_LC_ALL"
183189
export LC_ALL
184-
test_expect_success UTF8 "$name" "
190+
test_expect_success !MINGW,UTF8 "$name" "
185191
echo '# hello' >> exec-2.sh &&
186192
git update-index exec-2.sh &&
187193
git commit -m 'éï∏' &&
@@ -214,7 +220,7 @@ tree d667270a1f7b109f5eb3aaea21ede14b56bfdd6e
214220
tree 8f51f74cf0163afc9ad68a4b1537288c4558b5a4
215221
EOF
216222

217-
test_expect_success "$name" "test_cmp a expected"
223+
test_expect_success !MINGW "$name" "test_cmp a expected"
218224

219225
test_expect_success 'exit if remote refs are ambigious' "
220226
git config --add svn-remote.svn.fetch \

t/t9118-git-svn-funky-branch-names.sh

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,11 @@ test_expect_success 'setup svnrepo' '
2323
"$svnrepo/pr ject/branches/$scary_uri" &&
2424
svn_cmd cp -m "leading dot" "$svnrepo/pr ject/trunk" \
2525
"$svnrepo/pr ject/branches/.leading_dot" &&
26-
svn_cmd cp -m "trailing dot" "$svnrepo/pr ject/trunk" \
27-
"$svnrepo/pr ject/branches/trailing_dot." &&
26+
{
27+
test_have_prereq MINGW ||
28+
svn_cmd cp -m "trailing dot" "$svnrepo/pr ject/trunk" \
29+
"$svnrepo/pr ject/branches/trailing_dot."
30+
} &&
2831
svn_cmd cp -m "trailing .lock" "$svnrepo/pr ject/trunk" \
2932
"$svnrepo/pr ject/branches/trailing_dotlock.lock" &&
3033
svn_cmd cp -m "reflog" "$svnrepo/pr ject/trunk" \
@@ -45,7 +48,10 @@ test_expect_success 'test clone with funky branch names' '
4548
git rev-parse "refs/remotes/origin/more%20fun%20plugin!" &&
4649
git rev-parse "refs/remotes/origin/$scary_ref" &&
4750
git rev-parse "refs/remotes/origin/%2Eleading_dot" &&
48-
git rev-parse "refs/remotes/origin/trailing_dot%2E" &&
51+
{
52+
test_have_prereq MINGW ||
53+
git rev-parse "refs/remotes/origin/trailing_dot%2E"
54+
} &&
4955
git rev-parse "refs/remotes/origin/trailing_dotlock%2Elock" &&
5056
git rev-parse "refs/remotes/origin/$non_reflog"
5157
)

t/t9124-git-svn-dcommit-auto-props.sh

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,10 @@ test_expect_success 'enable auto-props config' '
3535

3636
test_expect_success 'add files matching auto-props' '
3737
echo "#!$SHELL_PATH" >exec1.sh &&
38-
chmod +x exec1.sh &&
38+
{
39+
test_have_prereq !POSIXPERM ||
40+
chmod +x exec1.sh
41+
} &&
3942
echo "hello" >hello.txt &&
4043
echo bar >bar &&
4144
git add exec1.sh hello.txt bar &&
@@ -49,7 +52,10 @@ test_expect_success 'disable auto-props config' '
4952

5053
test_expect_success 'add files matching disabled auto-props' '
5154
echo "#$SHELL_PATH" >exec2.sh &&
52-
chmod +x exec2.sh &&
55+
{
56+
test_have_prereq !POSIXPERM ||
57+
chmod +x exec2.sh
58+
} &&
5359
echo "world" >world.txt &&
5460
echo zot >zot &&
5561
git add exec2.sh world.txt zot &&
@@ -65,15 +71,21 @@ test_expect_success 'check resulting svn repository' '
6571
cd svnrepo &&
6672
6773
# Check properties from first commit.
68-
test "x$(svn_cmd propget svn:executable exec1.sh)" = "x*" &&
74+
{
75+
test_have_prereq !POSIXPERM ||
76+
test "x$(svn_cmd propget svn:executable exec1.sh)" = "x*"
77+
} &&
6978
test "x$(svn_cmd propget svn:mime-type exec1.sh)" = \
7079
"xapplication/x-shellscript" &&
7180
test "x$(svn_cmd propget svn:mime-type hello.txt)" = "xtext/plain" &&
7281
test "x$(svn_cmd propget svn:eol-style hello.txt)" = "xnative" &&
7382
test "x$(svn_cmd propget svn:mime-type bar)" = "x" &&
7483
7584
# Check properties from second commit.
76-
test "x$(svn_cmd propget svn:executable exec2.sh)" = "x*" &&
85+
{
86+
test_have_prereq !POSIXPERM ||
87+
test "x$(svn_cmd propget svn:executable exec2.sh)" = "x*"
88+
} &&
7789
test "x$(svn_cmd propget svn:mime-type exec2.sh)" = "x" &&
7890
test "x$(svn_cmd propget svn:mime-type world.txt)" = "x" &&
7991
test "x$(svn_cmd propget svn:eol-style world.txt)" = "x" &&

t/t9130-git-svn-authors-file.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ test_expect_success 'fetch continues after authors-file is fixed' '
9191
)
9292
'
9393

94-
test_expect_success 'fresh clone with svn.authors-file in config' '
94+
test_expect_success !MINGW 'fresh clone with svn.authors-file in config' '
9595
(
9696
rm -r "$GIT_DIR" &&
9797
test x = x"$(git config svn.authorsfile)" &&

0 commit comments

Comments
 (0)