git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 2/4] t4120-apply-popt: help systems with core.filemode=false

From
Pat Thoyts <patthoyts@users.sourceforge.net>
Date
Feb 3, 2011, 15:31 UTC
Message-ID
<1296747105-1663-3-git-send-email-patthoyts@users.sourceforge.net>
In-Reply-To
<1296747105-1663-1-git-send-email-patthoyts@users.sourceforge.net>
From: Johannes Sixt <j6t@kdbg.org>

A test case verifies that filemode-only patches work as expected. Help systems where "test -x" does not work by applying the test patch also to the index, where the effects can be verified even on such systems.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
---
 t/t4120-apply-popt.sh |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/t/t4120-apply-popt.sh b/t/t4120-apply-popt.sh
index 579c9e6..a33d510 100755
--- a/t/t4120-apply-popt.sh
+++ b/t/t4120-apply-popt.sh
@@ -6,6 +6,7 @@
 test_description='git apply -p handling.'
 
 . ./test-lib.sh
+. "$TEST_DIRECTORY"/lib-prereq-FILEMODE.sh
 
 test_expect_success setup '
 	mkdir sub &&
@@ -62,8 +63,12 @@ test_expect_success 'apply (-p2) diff, mode change only' '
 	old mode 100644
 	new mode 100755
 	EOF
-	chmod 644 file1 &&
-	git apply -p2 patch.chmod &&
+	test_chmod -x file1 &&
+	git apply --index -p2 patch.chmod &&
+	case $(git ls-files -s file1) in 100755*) : good;; *) false;; esac
+'
+
+test_expect_success FILEMODE 'file mode was changed' '
 	test -x file1
 '
 
-- 
1.7.4.msysgit.0
Previous: Pat ThoytsNext: Pat Thoyts
Message 3 of 11 in “some test fixes for msysGit”
  1. some test fixes for msysGitPat Thoyts, Feb 3, 2011
  2. 1/4 t3509: use unconstrained initial test to setup repository.Pat Thoyts, Feb 3, 2011
  3. 2/4 t4120-apply-popt: help systems with core.filemode=falsePat Thoyts, Feb 3, 2011
  4. 3/4 t7407: fix line endings for mingw buildPat Thoyts, Feb 3, 2011
  5. 4/4 t5526: avoid dependency on submodule orderPat Thoyts, Feb 3, 2011
  6. Johannes SixtFeb 3, 2011
  7. Johannes SchindelinFeb 3, 2011
  8. Johannes SixtFeb 3, 2011
  9. start_command: flush buffers in the WIN32 code path as wellJohannes Sixt, Feb 4, 2011
  10. Pat ThoytsFeb 4, 2011
  11. Johannes SchindelinFeb 3, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.