Skip to content

Commit e366fa2

Browse files
committed
Merge pull request #8 from nalla/update-to-2.3.0
git-svn test fixes
2 parents 1c2f357 + 879e40f commit e366fa2

5 files changed

+54
-22
lines changed

compat/mingw.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1655,7 +1655,12 @@ int mingw_rename(const char *pold, const char *pnew)
16551655
if (gle == ERROR_ACCESS_DENIED &&
16561656
(attrs = GetFileAttributesW(wpnew)) != INVALID_FILE_ATTRIBUTES) {
16571657
if (attrs & FILE_ATTRIBUTE_DIRECTORY) {
1658-
errno = EISDIR;
1658+
DWORD attrsold = GetFileAttributesW(wpold);
1659+
if (attrsold == INVALID_FILE_ATTRIBUTES ||
1660+
!(attrsold & FILE_ATTRIBUTE_DIRECTORY))
1661+
errno = EISDIR;
1662+
else if (!_wrmdir(wpnew))
1663+
goto repeat;
16591664
return -1;
16601665
}
16611666
if ((attrs & FILE_ATTRIBUTE_READONLY) &&

t/t9100-git-svn-basic.sh

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,11 @@ 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+
} &&
38+
echo "utf-8" >utf-8.file &&
3539
svn_cmd import -m "import for git svn" . "$svnrepo" >/dev/null
3640
) &&
3741
rm -rf import &&
@@ -117,7 +121,7 @@ test_expect_success "$name" '
117121

118122

119123
name='remove executable bit from a file'
120-
test_expect_success "$name" '
124+
test_expect_success !MINGW "$name" '
121125
rm -f "$GIT_DIR"/index &&
122126
git checkout -f -b mybranch5 ${remotes_git_svn} &&
123127
chmod -x exec.sh &&
@@ -130,7 +134,7 @@ test_expect_success "$name" '
130134

131135

132136
name='add executable bit back file'
133-
test_expect_success "$name" '
137+
test_expect_success !MINGW "$name" '
134138
chmod +x exec.sh &&
135139
git update-index exec.sh &&
136140
git commit -m "$name" &&
@@ -141,7 +145,7 @@ test_expect_success "$name" '
141145

142146

143147
name='executable file becomes a symlink to file'
144-
test_expect_success "$name" '
148+
test_expect_success !MINGW "$name" '
145149
rm exec.sh &&
146150
ln -s file exec.sh &&
147151
git update-index exec.sh &&
@@ -153,8 +157,11 @@ test_expect_success "$name" '
153157

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

156-
test_expect_success "$name" '
157-
chmod +x file &&
160+
test_expect_success !MINGW "$name" '
161+
{
162+
test_have_prereq !POSIXPERM ||
163+
chmod +x file
164+
} &&
158165
ln -s file exec-2.sh &&
159166
git update-index --add file exec-2.sh &&
160167
git commit -m "$name" &&
@@ -165,7 +172,7 @@ test_expect_success "$name" '
165172
test -h "$SVN_TREE"/exec-2.sh'
166173

167174
name='modify a symlink to become a file'
168-
test_expect_success "$name" '
175+
test_expect_success !MINGW "$name" '
169176
echo git help >help &&
170177
rm exec-2.sh &&
171178
cp help exec-2.sh &&
@@ -181,11 +188,13 @@ test_expect_success "$name" '
181188
name="commit with UTF-8 message: locale: $GIT_SVN_LC_ALL"
182189
LC_ALL="$GIT_SVN_LC_ALL"
183190
export LC_ALL
184-
test_expect_success UTF8 "$name" "
185-
echo '# hello' >> exec-2.sh &&
186-
git update-index exec-2.sh &&
187-
git commit -m 'éï∏' &&
188-
git svn set-tree HEAD"
191+
test_expect_success UTF8 "$name" '
192+
rm -f "$GIT_DIR"/index &&
193+
git checkout -f -b mybranch5 ${remotes_git_svn} &&
194+
echo "# hello" >> utf-8.file &&
195+
git update-index utf-8.file &&
196+
git commit -m "éï∏" &&
197+
git svn set-tree HEAD'
189198
unset LC_ALL
190199

191200
name='test fetch functionality (svn => git) with alternate GIT_SVN_ID'
@@ -214,7 +223,7 @@ tree d667270a1f7b109f5eb3aaea21ede14b56bfdd6e
214223
tree 8f51f74cf0163afc9ad68a4b1537288c4558b5a4
215224
EOF
216225

217-
test_expect_success "$name" "test_cmp a expected"
226+
test_expect_success !MINGW "$name" "test_cmp a expected"
218227

219228
test_expect_success 'exit if remote refs are ambigious' "
220229
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)