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

[PATCH 10/11] t3509, t4023, t4114: use test_ln_s_add to remove SYMLINKS prerequisite

From
Johannes Sixt <j6t@kdbg.org>
Date
Jun 1, 2013, 09:34 UTC
Message-ID
<984288047a44d58c55009c32a96d92104d7988c6.1370076477.git.j6t@kdbg.org>
In-Reply-To
<cover.1370076477.git.j6t@kdbg.org>

In t4023 and t4114, we have to remove the entries using 'git rm' because otherwise the entries that must turn from symbolic links to regular files would stay symbolic links in the index. For the same reason, we have to use 'git mv' instead of plain 'mv' in t3509.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
---
 t/t3509-cherry-pick-merge-df.sh   | 12 +++++-------
 t/t4023-diff-rename-typechange.sh | 28 ++++++++++++++--------------
 t/t4114-apply-typechange.sh       | 29 ++++++++++++++---------------
 3 files changed, 33 insertions(+), 36 deletions(-)
diff --git a/t/t3509-cherry-pick-merge-df.sh b/t/t3509-cherry-pick-merge-df.sh
index df921d1..a5b6a5f 100755
--- a/t/t3509-cherry-pick-merge-df.sh
+++ b/t/t3509-cherry-pick-merge-df.sh
@@ -10,17 +10,15 @@ test_expect_success 'Initialize repository' '
 	git commit -m a
 '
 
-test_expect_success SYMLINKS 'Setup rename across paths each below D/F conflicts' '
+test_expect_success 'Setup rename across paths each below D/F conflicts' '
 	mkdir b &&
-	ln -s ../a b/a &&
-	git add b &&
+	test_ln_s_add ../a b/a &&
 	git commit -m b &&
 
 	git checkout -b branch &&
 	rm b/a &&
-	mv a b/a &&
-	ln -s b/a a &&
-	git add . &&
+	git mv a b/a &&
+	test_ln_s_add b/a a &&
 	git commit -m swap &&
 
 	>f1 &&
@@ -28,7 +26,7 @@ test_expect_success SYMLINKS 'Setup rename across paths each below D/F conflicts
 	git commit -m f1
 '
 
-test_expect_success SYMLINKS 'Cherry-pick succeeds with rename across D/F conflicts' '
+test_expect_success 'Cherry-pick succeeds with rename across D/F conflicts' '
 	git reset --hard &&
 	git checkout master^0 &&
 	git cherry-pick branch
diff --git a/t/t4023-diff-rename-typechange.sh b/t/t4023-diff-rename-typechange.sh
index 5d20acf..55d549f 100755
--- a/t/t4023-diff-rename-typechange.sh
+++ b/t/t4023-diff-rename-typechange.sh
@@ -4,44 +4,44 @@ test_description='typechange rename detection'
 
 . ./test-lib.sh
 
-test_expect_success SYMLINKS setup '
+test_expect_success setup '
 
 	rm -f foo bar &&
 	cat "$TEST_DIRECTORY"/../COPYING >foo &&
-	ln -s linklink bar &&
-	git add foo bar &&
+	test_ln_s_add linklink bar &&
+	git add foo &&
 	git commit -a -m Initial &&
 	git tag one &&
 
-	rm -f foo bar &&
+	git rm -f foo bar &&
 	cat "$TEST_DIRECTORY"/../COPYING >bar &&
-	ln -s linklink foo &&
-	git add foo bar &&
+	test_ln_s_add linklink foo &&
+	git add bar &&
 	git commit -a -m Second &&
 	git tag two &&
 
-	rm -f foo bar &&
+	git rm -f foo bar &&
 	cat "$TEST_DIRECTORY"/../COPYING >foo &&
 	git add foo &&
 	git commit -a -m Third &&
 	git tag three &&
 
 	mv foo bar &&
-	ln -s linklink foo &&
-	git add foo bar &&
+	test_ln_s_add linklink foo &&
+	git add bar &&
 	git commit -a -m Fourth &&
 	git tag four &&
 
 	# This is purely for sanity check
 
-	rm -f foo bar &&
+	git rm -f foo bar &&
 	cat "$TEST_DIRECTORY"/../COPYING >foo &&
 	cat "$TEST_DIRECTORY"/../Makefile >bar &&
 	git add foo bar &&
 	git commit -a -m Fifth &&
 	git tag five &&
 
-	rm -f foo bar &&
+	git rm -f foo bar &&
 	cat "$TEST_DIRECTORY"/../Makefile >foo &&
 	cat "$TEST_DIRECTORY"/../COPYING >bar &&
 	git add foo bar &&
@@ -50,7 +50,7 @@ test_expect_success SYMLINKS setup '
 
 '
 
-test_expect_success SYMLINKS 'cross renames to be detected for regular files' '
+test_expect_success 'cross renames to be detected for regular files' '
 
 	git diff-tree five six -r --name-status -B -M | sort >actual &&
 	{
@@ -61,7 +61,7 @@ test_expect_success SYMLINKS 'cross renames to be detected for regular files' '
 
 '
 
-test_expect_success SYMLINKS 'cross renames to be detected for typechange' '
+test_expect_success 'cross renames to be detected for typechange' '
 
 	git diff-tree one two -r --name-status -B -M | sort >actual &&
 	{
@@ -72,7 +72,7 @@ test_expect_success SYMLINKS 'cross renames to be detected for typechange' '
 
 '
 
-test_expect_success SYMLINKS 'moves and renames' '
+test_expect_success 'moves and renames' '
 
 	git diff-tree three four -r --name-status -B -M | sort >actual &&
 	{
diff --git a/t/t4114-apply-typechange.sh b/t/t4114-apply-typechange.sh
index f12826f..ebadbc3 100755
--- a/t/t4114-apply-typechange.sh
+++ b/t/t4114-apply-typechange.sh
@@ -9,20 +9,19 @@ test_description='git apply should not get confused with type changes.
 
 . ./test-lib.sh
 
-test_expect_success SYMLINKS 'setup repository and commits' '
+test_expect_success 'setup repository and commits' '
 	echo "hello world" > foo &&
 	echo "hi planet" > bar &&
 	git update-index --add foo bar &&
 	git commit -m initial &&
 	git branch initial &&
 	rm -f foo &&
-	ln -s bar foo &&
-	git update-index foo &&
+	test_ln_s_add bar foo &&
 	git commit -m "foo symlinked to bar" &&
 	git branch foo-symlinked-to-bar &&
-	rm -f foo &&
+	git rm -f foo &&
 	echo "how far is the sun?" > foo &&
-	git update-index foo &&
+	git update-index --add foo &&
 	git commit -m "foo back to file" &&
 	git branch foo-back-to-file &&
 	printf "\0" > foo &&
@@ -42,7 +41,7 @@ test_expect_success SYMLINKS 'setup repository and commits' '
 	git branch foo-baz-renamed-from-foo
 	'
 
-test_expect_success SYMLINKS 'file renamed from foo to foo/baz' '
+test_expect_success 'file renamed from foo to foo/baz' '
 	git checkout -f initial &&
 	git diff-tree -M -p HEAD foo-baz-renamed-from-foo > patch &&
 	git apply --index < patch
@@ -50,7 +49,7 @@ test_expect_success SYMLINKS 'file renamed from foo to foo/baz' '
 test_debug 'cat patch'
 
 
-test_expect_success SYMLINKS 'file renamed from foo/baz to foo' '
+test_expect_success 'file renamed from foo/baz to foo' '
 	git checkout -f foo-baz-renamed-from-foo &&
 	git diff-tree -M -p HEAD initial > patch &&
 	git apply --index < patch
@@ -58,7 +57,7 @@ test_expect_success SYMLINKS 'file renamed from foo/baz to foo' '
 test_debug 'cat patch'
 
 
-test_expect_success SYMLINKS 'directory becomes file' '
+test_expect_success 'directory becomes file' '
 	git checkout -f foo-becomes-a-directory &&
 	git diff-tree -p HEAD initial > patch &&
 	git apply --index < patch
@@ -66,7 +65,7 @@ test_expect_success SYMLINKS 'directory becomes file' '
 test_debug 'cat patch'
 
 
-test_expect_success SYMLINKS 'file becomes directory' '
+test_expect_success 'file becomes directory' '
 	git checkout -f initial &&
 	git diff-tree -p HEAD foo-becomes-a-directory > patch &&
 	git apply --index < patch
@@ -74,7 +73,7 @@ test_expect_success SYMLINKS 'file becomes directory' '
 test_debug 'cat patch'
 
 
-test_expect_success SYMLINKS 'file becomes symlink' '
+test_expect_success 'file becomes symlink' '
 	git checkout -f initial &&
 	git diff-tree -p HEAD foo-symlinked-to-bar > patch &&
 	git apply --index < patch
@@ -82,21 +81,21 @@ test_expect_success SYMLINKS 'file becomes symlink' '
 test_debug 'cat patch'
 
 
-test_expect_success SYMLINKS 'symlink becomes file' '
+test_expect_success 'symlink becomes file' '
 	git checkout -f foo-symlinked-to-bar &&
 	git diff-tree -p HEAD foo-back-to-file > patch &&
 	git apply --index < patch
 	'
 test_debug 'cat patch'
 
-test_expect_success SYMLINKS 'binary file becomes symlink' '
+test_expect_success 'binary file becomes symlink' '
 	git checkout -f foo-becomes-binary &&
 	git diff-tree -p --binary HEAD foo-symlinked-to-bar > patch &&
 	git apply --index < patch
 	'
 test_debug 'cat patch'
 
-test_expect_success SYMLINKS 'symlink becomes binary file' '
+test_expect_success 'symlink becomes binary file' '
 	git checkout -f foo-symlinked-to-bar &&
 	git diff-tree -p --binary HEAD foo-becomes-binary > patch &&
 	git apply --index < patch
@@ -104,7 +103,7 @@ test_expect_success SYMLINKS 'symlink becomes binary file' '
 test_debug 'cat patch'
 
 
-test_expect_success SYMLINKS 'symlink becomes directory' '
+test_expect_success 'symlink becomes directory' '
 	git checkout -f foo-symlinked-to-bar &&
 	git diff-tree -p HEAD foo-becomes-a-directory > patch &&
 	git apply --index < patch
@@ -112,7 +111,7 @@ test_expect_success SYMLINKS 'symlink becomes directory' '
 test_debug 'cat patch'
 
 
-test_expect_success SYMLINKS 'directory becomes symlink' '
+test_expect_success 'directory becomes symlink' '
 	git checkout -f foo-becomes-a-directory &&
 	git diff-tree -p HEAD foo-symlinked-to-bar > patch &&
 	git apply --index < patch
-- 
1.8.3.rc1.32.g8b61cbb
Previous: Johannes SixtNext: Junio C Hamano
Message 20 of 35 in “Increase test coverage on Windows by removing SYMLINKS from many tests”
  1. 00/11 Increase test coverage on Windows by removing SYMLINKS from many testsJohannes Sixt, Jun 1, 2013
  2. 01/11 test-chmtime: Fix exit code on WindowsJohannes Sixt, Jun 1, 2013
  3. 02/11 t2100: modernize style and unroll a loop of test casesJohannes Sixt, Jun 1, 2013
  4. 03/11 t3010: modernize styleJohannes Sixt, Jun 1, 2013
  5. 04/11 tests: introduce test_ln_s and test_ln_s_addJohannes Sixt, Jun 1, 2013
  6. Ramkumar RamachandraJun 1, 2013
  7. Johannes SixtJun 1, 2013
  8. Ramkumar RamachandraJun 1, 2013
  9. 05/11 tests: use test_ln_s_add to remove SYMLINKS prerequisite (trivial cases)Johannes Sixt, Jun 1, 2013
  10. Junio C HamanoJun 4, 2013
  11. Johannes SixtJun 5, 2013
  12. Junio C HamanoJun 4, 2013
  13. Johannes SixtJun 5, 2013
  14. 06/11 t0000: use test_ln_s_add to remove SYMLINKS prerequisiteJohannes Sixt, Jun 1, 2013
  15. 07/11 t2100: use test_ln_s_add to remove SYMLINKS prerequisiteJohannes Sixt, Jun 1, 2013
  16. Junio C HamanoJun 4, 2013
  17. Johannes SixtJun 5, 2013
  18. 08/11 t3030: use test_ln_s_add to remove SYMLINKS prerequisiteJohannes Sixt, Jun 1, 2013
  19. 09/11 t3100: use test_ln_s_add to remove SYMLINKS prerequisiteJohannes Sixt, Jun 1, 2013
  20. 10/11 t3509, t4023, t4114: use test_ln_s_add to remove SYMLINKS prerequisiteJohannes Sixt, Jun 1, 2013
  21. Junio C HamanoJun 2, 2013
  22. 11/11 t6035: use test_ln_s_add to remove SYMLINKS prerequisiteJohannes Sixt, Jun 1, 2013
  23. 00/10 Increase test coverage on Windows by removing SYMLINKS from many testsJohannes Sixt, Jun 7, 2013
  24. Junio C HamanoJun 7, 2013
  25. 01/10 test-chmtime: Fix exit code on WindowsJohannes Sixt, Jun 7, 2013
  26. Erik Faye-LundNov 20, 2013
  27. 02/10 t3010: modernize styleJohannes Sixt, Jun 7, 2013
  28. 03/10 tests: introduce test_ln_s_addJohannes Sixt, Jun 7, 2013
  29. 04/10 tests: use test_ln_s_add to remove SYMLINKS prerequisite (trivial cases)Johannes Sixt, Jun 7, 2013
  30. 05/10 t0000: use test_ln_s_add to remove SYMLINKS prerequisiteJohannes Sixt, Jun 7, 2013
  31. 06/10 t3030: use test_ln_s_add to remove SYMLINKS prerequisiteJohannes Sixt, Jun 7, 2013
  32. 07/10 t3100: use test_ln_s_add to remove SYMLINKS prerequisiteJohannes Sixt, Jun 7, 2013
  33. 08/10 t3509, t4023, t4114: use test_ln_s_add to remove SYMLINKS prerequisiteJohannes Sixt, Jun 7, 2013
  34. 09/10 t6035: use test_ln_s_add to remove SYMLINKS prerequisiteJohannes Sixt, Jun 7, 2013
  35. 10/10 t4011: remove SYMLINKS prerequisiteJohannes Sixt, Jun 7, 2013

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.