[PATCH 17/19] mingw: fix git-svn tests that expect chmod to work

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: 마누엘 <nalla@xxxxxxxxxxxxxxxxxxxxxxxx>

Some git-svn tests expect that the executable bit of files can be
toggled. On Windows, this is not possible because Windows' Access
Control Lists are much more fine-grained than the POSIX permission
concept. Let's just not try to flip the executable bit.

This lets t9118-git-svn-funky-branch-names.sh and
t9124-git-svn-dcommit-auto-props.sh pass in Git for Windows' SDK,
and partially fixes t9100-git-svn-basic.sh.

Signed-off-by: 마누엘 <nalla@xxxxxxxxxxxxxxxxxxxxxxxx>
Signed-off-by: Johannes Schindelin <johannes.schindelin@xxxxxx>
---
 t/t9100-git-svn-basic.sh              |  5 ++++-
 t/t9118-git-svn-funky-branch-names.sh | 12 +++++++++---
 t/t9124-git-svn-dcommit-auto-props.sh | 20 ++++++++++++++++----
 3 files changed, 29 insertions(+), 8 deletions(-)

diff --git a/t/t9100-git-svn-basic.sh b/t/t9100-git-svn-basic.sh
index dbb440b..bca7ec8 100755
--- a/t/t9100-git-svn-basic.sh
+++ b/t/t9100-git-svn-basic.sh
@@ -38,7 +38,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 &&
diff --git a/t/t9118-git-svn-funky-branch-names.sh b/t/t9118-git-svn-funky-branch-names.sh
index a221915..49775a5 100755
--- a/t/t9118-git-svn-funky-branch-names.sh
+++ b/t/t9118-git-svn-funky-branch-names.sh
@@ -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"
 	)
diff --git a/t/t9124-git-svn-dcommit-auto-props.sh b/t/t9124-git-svn-dcommit-auto-props.sh
index aa841e1..c851121 100755
--- a/t/t9124-git-svn-dcommit-auto-props.sh
+++ b/t/t9124-git-svn-dcommit-auto-props.sh
@@ -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" &&
-- 
2.7.0.windows.1.7.g55a05c8


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]