mirror of
https://github.com/git/git.git
synced 2026-02-03 22:42:53 +00:00
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: 마누엘 <nalla@users.noreply.github.com>
This commit is contained in:
@@ -31,7 +31,10 @@ test_expect_success \
|
||||
mkdir bar &&
|
||||
echo "zzz" >bar/zzz &&
|
||||
echo "#!/bin/sh" >exec.sh &&
|
||||
chmod +x exec.sh &&
|
||||
{
|
||||
test_have_prereq !POSIXPERM ||
|
||||
chmod +x exec.sh
|
||||
} &&
|
||||
svn_cmd import -m "import for git svn" . "$svnrepo" >/dev/null
|
||||
) &&
|
||||
rm -rf import &&
|
||||
@@ -117,7 +120,7 @@ test_expect_success "$name" '
|
||||
|
||||
|
||||
name='remove executable bit from a file'
|
||||
test_expect_success "$name" '
|
||||
test_expect_success !MINGW "$name" '
|
||||
rm -f "$GIT_DIR"/index &&
|
||||
git checkout -f -b mybranch5 ${remotes_git_svn} &&
|
||||
chmod -x exec.sh &&
|
||||
@@ -130,7 +133,7 @@ test_expect_success "$name" '
|
||||
|
||||
|
||||
name='add executable bit back file'
|
||||
test_expect_success "$name" '
|
||||
test_expect_success !MINGW "$name" '
|
||||
chmod +x exec.sh &&
|
||||
git update-index exec.sh &&
|
||||
git commit -m "$name" &&
|
||||
@@ -141,7 +144,7 @@ test_expect_success "$name" '
|
||||
|
||||
|
||||
name='executable file becomes a symlink to file'
|
||||
test_expect_success "$name" '
|
||||
test_expect_success !MINGW "$name" '
|
||||
rm exec.sh &&
|
||||
ln -s file exec.sh &&
|
||||
git update-index exec.sh &&
|
||||
@@ -153,8 +156,11 @@ test_expect_success "$name" '
|
||||
|
||||
name='new symlink is added to a file that was also just made executable'
|
||||
|
||||
test_expect_success "$name" '
|
||||
chmod +x file &&
|
||||
test_expect_success !MINGW "$name" '
|
||||
{
|
||||
test_have_prereq !POSIXPERM ||
|
||||
chmod +x file
|
||||
} &&
|
||||
ln -s file exec-2.sh &&
|
||||
git update-index --add file exec-2.sh &&
|
||||
git commit -m "$name" &&
|
||||
@@ -165,7 +171,7 @@ test_expect_success "$name" '
|
||||
test -h "$SVN_TREE"/exec-2.sh'
|
||||
|
||||
name='modify a symlink to become a file'
|
||||
test_expect_success "$name" '
|
||||
test_expect_success !MINGW "$name" '
|
||||
echo git help >help &&
|
||||
rm exec-2.sh &&
|
||||
cp help exec-2.sh &&
|
||||
@@ -181,7 +187,7 @@ test_expect_success "$name" '
|
||||
name="commit with UTF-8 message: locale: $GIT_SVN_LC_ALL"
|
||||
LC_ALL="$GIT_SVN_LC_ALL"
|
||||
export LC_ALL
|
||||
test_expect_success UTF8 "$name" "
|
||||
test_expect_success !MINGW,UTF8 "$name" "
|
||||
echo '# hello' >> exec-2.sh &&
|
||||
git update-index exec-2.sh &&
|
||||
git commit -m 'éï∏' &&
|
||||
@@ -214,7 +220,7 @@ tree d667270a1f7b109f5eb3aaea21ede14b56bfdd6e
|
||||
tree 8f51f74cf0163afc9ad68a4b1537288c4558b5a4
|
||||
EOF
|
||||
|
||||
test_expect_success "$name" "test_cmp a expected"
|
||||
test_expect_success !MINGW "$name" "test_cmp a expected"
|
||||
|
||||
test_expect_success 'exit if remote refs are ambigious' "
|
||||
git config --add svn-remote.svn.fetch \
|
||||
|
||||
@@ -23,8 +23,11 @@ test_expect_success 'setup svnrepo' '
|
||||
"$svnrepo/pr ject/branches/$scary_uri" &&
|
||||
svn_cmd cp -m "leading dot" "$svnrepo/pr ject/trunk" \
|
||||
"$svnrepo/pr ject/branches/.leading_dot" &&
|
||||
svn_cmd cp -m "trailing dot" "$svnrepo/pr ject/trunk" \
|
||||
"$svnrepo/pr ject/branches/trailing_dot." &&
|
||||
{
|
||||
test_have_prereq MINGW ||
|
||||
svn_cmd cp -m "trailing dot" "$svnrepo/pr ject/trunk" \
|
||||
"$svnrepo/pr ject/branches/trailing_dot."
|
||||
} &&
|
||||
svn_cmd cp -m "trailing .lock" "$svnrepo/pr ject/trunk" \
|
||||
"$svnrepo/pr ject/branches/trailing_dotlock.lock" &&
|
||||
svn_cmd cp -m "reflog" "$svnrepo/pr ject/trunk" \
|
||||
@@ -45,7 +48,10 @@ test_expect_success 'test clone with funky branch names' '
|
||||
git rev-parse "refs/remotes/origin/more%20fun%20plugin!" &&
|
||||
git rev-parse "refs/remotes/origin/$scary_ref" &&
|
||||
git rev-parse "refs/remotes/origin/%2Eleading_dot" &&
|
||||
git rev-parse "refs/remotes/origin/trailing_dot%2E" &&
|
||||
{
|
||||
test_have_prereq MINGW ||
|
||||
git rev-parse "refs/remotes/origin/trailing_dot%2E"
|
||||
} &&
|
||||
git rev-parse "refs/remotes/origin/trailing_dotlock%2Elock" &&
|
||||
git rev-parse "refs/remotes/origin/$non_reflog"
|
||||
)
|
||||
|
||||
@@ -35,7 +35,10 @@ test_expect_success 'enable auto-props config' '
|
||||
|
||||
test_expect_success 'add files matching auto-props' '
|
||||
echo "#!$SHELL_PATH" >exec1.sh &&
|
||||
chmod +x exec1.sh &&
|
||||
{
|
||||
test_have_prereq !POSIXPERM ||
|
||||
chmod +x exec1.sh
|
||||
} &&
|
||||
echo "hello" >hello.txt &&
|
||||
echo bar >bar &&
|
||||
git add exec1.sh hello.txt bar &&
|
||||
@@ -49,7 +52,10 @@ test_expect_success 'disable auto-props config' '
|
||||
|
||||
test_expect_success 'add files matching disabled auto-props' '
|
||||
echo "#$SHELL_PATH" >exec2.sh &&
|
||||
chmod +x exec2.sh &&
|
||||
{
|
||||
test_have_prereq !POSIXPERM ||
|
||||
chmod +x exec2.sh
|
||||
} &&
|
||||
echo "world" >world.txt &&
|
||||
echo zot >zot &&
|
||||
git add exec2.sh world.txt zot &&
|
||||
@@ -65,7 +71,10 @@ test_expect_success 'check resulting svn repository' '
|
||||
cd svnrepo &&
|
||||
|
||||
# Check properties from first commit.
|
||||
test "x$(svn_cmd propget svn:executable exec1.sh)" = "x*" &&
|
||||
{
|
||||
test_have_prereq !POSIXPERM ||
|
||||
test "x$(svn_cmd propget svn:executable exec1.sh)" = "x*"
|
||||
} &&
|
||||
test "x$(svn_cmd propget svn:mime-type exec1.sh)" = \
|
||||
"xapplication/x-shellscript" &&
|
||||
test "x$(svn_cmd propget svn:mime-type hello.txt)" = "xtext/plain" &&
|
||||
@@ -73,7 +82,10 @@ test_expect_success 'check resulting svn repository' '
|
||||
test "x$(svn_cmd propget svn:mime-type bar)" = "x" &&
|
||||
|
||||
# Check properties from second commit.
|
||||
test "x$(svn_cmd propget svn:executable exec2.sh)" = "x*" &&
|
||||
{
|
||||
test_have_prereq !POSIXPERM ||
|
||||
test "x$(svn_cmd propget svn:executable exec2.sh)" = "x*"
|
||||
} &&
|
||||
test "x$(svn_cmd propget svn:mime-type exec2.sh)" = "x" &&
|
||||
test "x$(svn_cmd propget svn:mime-type world.txt)" = "x" &&
|
||||
test "x$(svn_cmd propget svn:eol-style world.txt)" = "x" &&
|
||||
|
||||
@@ -91,7 +91,7 @@ test_expect_success 'fetch continues after authors-file is fixed' '
|
||||
)
|
||||
'
|
||||
|
||||
test_expect_success 'fresh clone with svn.authors-file in config' '
|
||||
test_expect_success !MINGW 'fresh clone with svn.authors-file in config' '
|
||||
(
|
||||
rm -r "$GIT_DIR" &&
|
||||
test x = x"$(git config svn.authorsfile)" &&
|
||||
|
||||
Reference in New Issue
Block a user