{"thread":{"id":"34006","subject":"[PATCH 01/11] test-chmtime: Fix exit code on Windows","startedAt":"2013-06-01T09:34:19Z","lastAt":"2013-11-20T14:00:06Z","messageCount":35,"participants":["Johannes Sixt","Ramkumar Ramachandra","Junio C Hamano","Erik Faye-Lund"],"isPatch":true,"patchVersion":1,"patchTotal":11},"messages":[{"id":"219117","messageId":"cover.1370076477.git.j6t@kdbg.org","threadId":"34006","inReplyTo":null,"subject":"[PATCH 00/11] Increase test coverage on Windows by removing SYMLINKS from many tests","fromName":"Johannes Sixt","fromEmail":"j6t@kdbg.org","sentAt":"2013-06-01T09:34:19Z","receivedAt":"2013-06-01T09:34:19Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Many tests that involve symbolic links actually check only whether our\nalgorithms are correct by investigating the contents of the object\ndatabase and the index. Only some of them check the filesystem.\n\nThis series introduces a function test_ln_s_add that inserts a symbolic\nlink in the index even if the filesystem does not support symbolic links.\nBy using this function, many more tests can be run when the filesystem\ndoes not have symblic links, aka Windows.\n\nThe patches touch a number of test files that do not follow the modern\nstyle. But I modernized only the two test files where the subsequent\nchange to use test_ln_s_add would otherwise be rather inconvenient or\nobscure.\n\nJohannes Sixt (11):\n  test-chmtime: Fix exit code on Windows\n  t2100: modernize style and unroll a loop of test cases\n  t3010: modernize style\n  tests: introduce test_ln_s and test_ln_s_add\n  tests: use test_ln_s_add to remove SYMLINKS prerequisite (trivial\n    cases)\n  t0000: use test_ln_s_add to remove SYMLINKS prerequisite\n  t2100: use test_ln_s_add to remove SYMLINKS prerequisite\n  t3030: use test_ln_s_add to remove SYMLINKS prerequisite\n  t3100: use test_ln_s_add to remove SYMLINKS prerequisite\n  t3509, t4023, t4114: use test_ln_s_add to remove SYMLINKS prerequisite\n  t6035: use test_ln_s_add to remove SYMLINKS prerequisite\n\n t/README                               |  17 +++++\n t/t0000-basic.sh                       |  39 +++---------\n t/t1004-read-tree-m-u-wf.sh            |   7 +--\n t/t2001-checkout-cache-clash.sh        |   7 +--\n t/t2003-checkout-cache-mkdir.sh        |   8 +--\n t/t2004-checkout-cache-temp.sh         |   5 +-\n t/t2007-checkout-symlink.sh            |  12 ++--\n t/t2021-checkout-overwrite.sh          |  12 ++--\n t/t2100-update-cache-badpath.sh        |  71 +++++++++++----------\n t/t2200-add-update.sh                  |   5 +-\n t/t3000-ls-files-others.sh             |   7 +--\n t/t3010-ls-files-killed-modified.sh    | 112 +++++++++++++++------------------\n t/t3030-merge-recursive.sh             |  62 ++++++++----------\n t/t3100-ls-tree-restrict.sh            |  42 +++++--------\n t/t3509-cherry-pick-merge-df.sh        |  12 ++--\n t/t3700-add.sh                         |  15 ++---\n t/t3903-stash.sh                       |  39 ++++++++----\n t/t4008-diff-break-rewrite.sh          |  12 ++--\n t/t4011-diff-symlink.sh                |  23 ++++---\n t/t4023-diff-rename-typechange.sh      |  28 ++++-----\n t/t4030-diff-textconv.sh               |   8 +--\n t/t4114-apply-typechange.sh            |  29 +++++----\n t/t4115-apply-symlink.sh               |  10 ++-\n t/t4122-apply-symlink-inside.sh        |   8 +--\n t/t6035-merge-dir-to-symlink.sh        |  73 +++++++++++++--------\n t/t7001-mv.sh                          |  18 +++---\n t/t7607-merge-overwrite.sh             |   5 +-\n t/t8006-blame-textconv.sh              |  14 ++---\n t/t8007-cat-file-textconv.sh           |  10 ++-\n t/t9350-fast-export.sh                 |   5 +-\n t/t9500-gitweb-standalone-no-errors.sh |  15 ++---\n t/test-lib-functions.sh                |  30 +++++++++\n test-chmtime.c                         |   8 +--\n 33 files changed, 391 insertions(+), 377 deletions(-)\n\n-- \n1.8.3.rc1.32.g8b61cbb\n"},{"id":"219116","messageId":"c5913d1a95ed5a9aaa92eece2484274949acc78e.1370076477.git.j6t@kdbg.org","threadId":"34006","inReplyTo":"cover.1370076477.git.j6t@kdbg.org","subject":"[PATCH 01/11] test-chmtime: Fix exit code on Windows","fromName":"Johannes Sixt","fromEmail":"j6t@kdbg.org","sentAt":"2013-06-01T09:34:20Z","receivedAt":"2013-06-01T09:34:20Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"MinGW's bash does not recognize an exit code -1 as failure. See also\n47e3de0e (MinGW: truncate exit()'s argument to lowest 8 bits) and 2488df84\n(builtin run_command: do not exit with -1). Exit code 1 is good enough.\n\nSigned-off-by: Johannes Sixt <j6t@kdbg.org>\n---\n test-chmtime.c | 8 ++++----\n 1 file changed, 4 insertions(+), 4 deletions(-)\n\ndiff --git a/test-chmtime.c b/test-chmtime.c\nindex 94903c4..28b2313 100644\n--- a/test-chmtime.c\n+++ b/test-chmtime.c\n@@ -84,7 +84,7 @@ int main(int argc, char *argv[])\n \t\tif (stat(argv[i], &sb) < 0) {\n \t\t\tfprintf(stderr, \"Failed to stat %s: %s\\n\",\n \t\t\t        argv[i], strerror(errno));\n-\t\t\treturn -1;\n+\t\t\treturn 1;\n \t\t}\n \n #ifdef WIN32\n@@ -92,7 +92,7 @@ int main(int argc, char *argv[])\n \t\t\t\tchmod(argv[i], sb.st_mode | S_IWUSR)) {\n \t\t\tfprintf(stderr, \"Could not make user-writable %s: %s\",\n \t\t\t\targv[i], strerror(errno));\n-\t\t\treturn -1;\n+\t\t\treturn 1;\n \t\t}\n #endif\n \n@@ -107,7 +107,7 @@ int main(int argc, char *argv[])\n \t\tif (utb.modtime != sb.st_mtime && utime(argv[i], &utb) < 0) {\n \t\t\tfprintf(stderr, \"Failed to modify time on %s: %s\\n\",\n \t\t\t        argv[i], strerror(errno));\n-\t\t\treturn -1;\n+\t\t\treturn 1;\n \t\t}\n \t}\n \n@@ -115,5 +115,5 @@ int main(int argc, char *argv[])\n \n usage:\n \tfprintf(stderr, \"usage: %s %s\\n\", argv[0], usage_str);\n-\treturn -1;\n+\treturn 1;\n }\n-- \n1.8.3.rc1.32.g8b61cbb\n"},{"id":"219118","messageId":"e0707cd8cb027e8fb7f17fd7ec1083cffc6e8fef.1370076477.git.j6t@kdbg.org","threadId":"34006","inReplyTo":"cover.1370076477.git.j6t@kdbg.org","subject":"[PATCH 02/11] t2100: modernize style and unroll a loop of test cases","fromName":"Johannes Sixt","fromEmail":"j6t@kdbg.org","sentAt":"2013-06-01T09:34:21Z","receivedAt":"2013-06-01T09:34:21Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"In particular, move all test preparations inside test_expect_success.\n\nIn a subsequent patch, we are going to move test case path3 out of the\nloop of test cases. Use this opportunity to linearize the tests.\n\nSigned-off-by: Johannes Sixt <j6t@kdbg.org>\n---\n t/t2100-update-cache-badpath.sh | 81 ++++++++++++++++++++++++-----------------\n 1 file changed, 47 insertions(+), 34 deletions(-)\n\ndiff --git a/t/t2100-update-cache-badpath.sh b/t/t2100-update-cache-badpath.sh\nindex 2df3fdd..a3f9255 100755\n--- a/t/t2100-update-cache-badpath.sh\n+++ b/t/t2100-update-cache-badpath.sh\n@@ -24,38 +24,51 @@ All of the attempts should fail.\n \n . ./test-lib.sh\n \n-mkdir path2 path3\n-date >path0\n-if test_have_prereq SYMLINKS\n-then\n-\tln -s xyzzy path1\n-else\n-\tdate > path1\n-fi\n-date >path2/file2\n-date >path3/file3\n-\n-test_expect_success \\\n-    'git update-index --add to add various paths.' \\\n-    'git update-index --add -- path0 path1 path2/file2 path3/file3'\n-\n-rm -fr path?\n-\n-mkdir path0 path1\n-date >path2\n-if test_have_prereq SYMLINKS\n-then\n-\tln -s frotz path3\n-else\n-\tdate > path3\n-fi\n-date >path0/file0\n-date >path1/file1\n-\n-for p in path0/file0 path1/file1 path2 path3\n-do\n-\ttest_expect_success \\\n-\t    \"git update-index to add conflicting path $p should fail.\" \\\n-\t    \"test_must_fail git update-index --add -- $p\"\n-done\n+test_expect_success 'git update-index --add to add various paths' '\n+\n+\tmkdir path2 path3 &&\n+\tdate >path0 &&\n+\tif test_have_prereq SYMLINKS\n+\tthen\n+\t\tln -s xyzzy path1\n+\telse\n+\t\tdate >path1\n+\tfi &&\n+\tdate >path2/file2 &&\n+\tdate >path3/file3 &&\n+\ttest_when_finished \"rm -fr path0 path1 path2 path3\" &&\n+\tgit update-index --add -- path0 path1 path2/file2 path3/file3\n+'\n+\n+test_expect_success 'git update-index to add conflicting path path0/file0 should fail' '\n+\n+\tmkdir path0 &&\n+\tdate >path0/file0 &&\n+\ttest_must_fail git update-index --add -- path0/file0\n+'\n+\n+test_expect_success 'git update-index to add conflicting path path1/file1 should fail' '\n+\n+\tmkdir path1 &&\n+\tdate >path1/file1 &&\n+\ttest_must_fail git update-index --add -- path1/file1\n+'\n+\n+test_expect_success 'git update-index to add conflicting file path2 should fail' '\n+\n+\tdate >path2 &&\n+\ttest_must_fail git update-index --add -- path2\n+'\n+\n+test_expect_success 'git update-index to add conflicting symlink path3 should fail' '\n+\n+\tif test_have_prereq SYMLINKS\n+\tthen\n+\t\tln -s xyzzy path3\n+\telse\n+\t\tdate >path3\n+\tfi &&\n+\ttest_must_fail git update-index --add -- path3\n+'\n+\n test_done\n-- \n1.8.3.rc1.32.g8b61cbb\n"},{"id":"219126","messageId":"38a0a3fdeda9087894935052e5a72c1761274221.1370076477.git.j6t@kdbg.org","threadId":"34006","inReplyTo":"cover.1370076477.git.j6t@kdbg.org","subject":"[PATCH 03/11] t3010: modernize style","fromName":"Johannes Sixt","fromEmail":"j6t@kdbg.org","sentAt":"2013-06-01T09:34:22Z","receivedAt":"2013-06-01T09:34:22Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"In particular:\n\n- move test preparations inside test_expect_success\n\n- place test description on the test_expect_success line\n\n- indent with a tab\n\nSigned-off-by: Johannes Sixt <j6t@kdbg.org>\n---\n t/t3010-ls-files-killed-modified.sh | 123 ++++++++++++++++++------------------\n 1 file changed, 61 insertions(+), 62 deletions(-)\n\ndiff --git a/t/t3010-ls-files-killed-modified.sh b/t/t3010-ls-files-killed-modified.sh\nindex 95671c2..2d0ff2d 100755\n--- a/t/t3010-ls-files-killed-modified.sh\n+++ b/t/t3010-ls-files-killed-modified.sh\n@@ -37,71 +37,70 @@ modified without reporting path9 and path10.\n '\n . ./test-lib.sh\n \n-date >path0\n-if test_have_prereq SYMLINKS\n-then\n-\tln -s xyzzy path1\n-else\n-\tdate > path1\n-fi\n-mkdir path2 path3\n-date >path2/file2\n-date >path3/file3\n-: >path7\n-date >path8\n-: >path9\n-date >path10\n-test_expect_success \\\n-    'git update-index --add to add various paths.' \\\n-    \"git update-index --add -- path0 path1 path?/file? path7 path8 path9 path10\"\n-\n-rm -fr path? ;# leave path10 alone\n-date >path2\n-if test_have_prereq SYMLINKS\n-then\n-\tln -s frotz path3\n-\tln -s nitfol path5\n-else\n-\tdate > path3\n-\tdate > path5\n-fi\n-mkdir path0 path1 path6\n-date >path0/file0\n-date >path1/file1\n-date >path6/file6\n-date >path7\n-: >path8\n-: >path9\n-touch path10\n+test_expect_success 'git update-index --add to add various paths.' '\n+\tdate >path0 &&\n+\tif test_have_prereq SYMLINKS\n+\tthen\n+\t\tln -s xyzzy path1\n+\telse\n+\t\tdate > path1\n+\tfi &&\n+\tmkdir path2 path3 &&\n+\tdate >path2/file2 &&\n+\tdate >path3/file3 &&\n+\t: >path7 &&\n+\tdate >path8 &&\n+\t: >path9 &&\n+\tdate >path10 &&\n+\tgit update-index --add -- path0 path1 path?/file? path7 path8 path9 path10 &&\n+\trm -fr path?\t# leave path10 alone\n+'\n \n-test_expect_success \\\n-    'git ls-files -k to show killed files.' \\\n-    'git ls-files -k >.output'\n-cat >.expected <<EOF\n-path0/file0\n-path1/file1\n-path2\n-path3\n-EOF\n+test_expect_success 'git ls-files -k to show killed files.' '\n+\tdate >path2 &&\n+\tif test_have_prereq SYMLINKS\n+\tthen\n+\t\tln -s frotz path3 &&\n+\t\tln -s nitfol path5\n+\telse\n+\t\tdate >path3 &&\n+\t\tdate >path5\n+\tfi &&\n+\tmkdir path0 path1 path6 &&\n+\tdate >path0/file0 &&\n+\tdate >path1/file1 &&\n+\tdate >path6/file6 &&\n+\tdate >path7 &&\n+\t: >path8 &&\n+\t: >path9 &&\n+\ttouch path10 &&\n+\tgit ls-files -k >.output\n+'\n \n-test_expect_success \\\n-    'validate git ls-files -k output.' \\\n-    'test_cmp .expected .output'\n+test_expect_success 'validate git ls-files -k output.' '\n+\tcat >.expected <<-\\EOF &&\n+\tpath0/file0\n+\tpath1/file1\n+\tpath2\n+\tpath3\n+\tEOF\n+\ttest_cmp .expected .output\n+'\n \n-test_expect_success \\\n-    'git ls-files -m to show modified files.' \\\n-    'git ls-files -m >.output'\n-cat >.expected <<EOF\n-path0\n-path1\n-path2/file2\n-path3/file3\n-path7\n-path8\n-EOF\n+test_expect_success 'git ls-files -m to show modified files.' '\n+\tgit ls-files -m >.output\n+'\n \n-test_expect_success \\\n-    'validate git ls-files -m output.' \\\n-    'test_cmp .expected .output'\n+test_expect_success 'validate git ls-files -m output.' '\n+\tcat >.expected <<-\\EOF &&\n+\tpath0\n+\tpath1\n+\tpath2/file2\n+\tpath3/file3\n+\tpath7\n+\tpath8\n+\tEOF\n+\ttest_cmp .expected .output\n+'\n \n test_done\n-- \n1.8.3.rc1.32.g8b61cbb\n"},{"id":"219125","messageId":"c7be5891891d1eeba540a5a24f07d58514345b2b.1370076477.git.j6t@kdbg.org","threadId":"34006","inReplyTo":"cover.1370076477.git.j6t@kdbg.org","subject":"[PATCH 04/11] tests: introduce test_ln_s and test_ln_s_add","fromName":"Johannes Sixt","fromEmail":"j6t@kdbg.org","sentAt":"2013-06-01T09:34:23Z","receivedAt":"2013-06-01T09:34:23Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Add new functions that create symbolic links and add them to the index to\nbe used in cases where a symbolic link is not required on the file system.\nWe will use them to remove many SYMLINKS prerequisites from test cases.\n\nSigned-off-by: Johannes Sixt <j6t@kdbg.org>\n---\n t/README                | 17 +++++++++++++++++\n t/test-lib-functions.sh | 30 ++++++++++++++++++++++++++++++\n 2 files changed, 47 insertions(+)\n\ndiff --git a/t/README b/t/README\nindex e669bb3..bb938f2 100644\n--- a/t/README\n+++ b/t/README\n@@ -592,6 +592,23 @@ library for your script to use.\n \t\ttest_cmp expected actual\n \t'\n \n+ - test_ln_s <path1> <path2>\n+   test_ln_s_add <path1> <path2>\n+\n+   These functions help systems whose filesystem does not support symbolic\n+   links. Use them to add a symbolic link entry to the index when it is\n+   not important that the file system entry is a symbolic link.\n+\n+   Use test_ln_s instead of plain \"ln -s foo bar\" and test_ln_s_add instead\n+   of the sequence\n+\n+\tln -s foo bar &&\n+\tgit add bar\n+\n+   Sometimes it is possible to split a test in a part that does not need\n+   the symbolic link in the file system and a part that does; then only\n+   the latter part need be protected by a SYMLINKS prerequisite (see below).\n+\n Prerequisites\n -------------\n \ndiff --git a/t/test-lib-functions.sh b/t/test-lib-functions.sh\nindex 5251009..ad7905a 100644\n--- a/t/test-lib-functions.sh\n+++ b/t/test-lib-functions.sh\n@@ -679,3 +679,33 @@ test_create_repo () {\n \t\tmv .git/hooks .git/hooks-disabled\n \t) || exit\n }\n+\n+# These functions help on symlink challenged file systems when it is not\n+# important that the file system entry is a symbolic link:\n+#\n+# - Use test_ln_s_add instead of \"ln -s x y && git add y\" to add a\n+#   symbolic link entry y to the index.\n+#\n+# - Use test_ln_s instead of \"ln -s x y\" when y has been added as a\n+#   symbolic link entry earlier.\n+\n+test_ln_s_add () {\n+\tif test_have_prereq SYMLINKS\n+\tthen\n+\t\tln -s \"$1\" \"$2\" &&\n+\t\tgit update-index --add \"$2\"\n+\telse\n+\t\tprintf '%s' \"$1\" >\"$2\" &&\n+\t\tln_s_obj=$(git hash-object -w \"$2\") &&\n+\t\tgit update-index --add --cacheinfo 120000 $ln_s_obj \"$2\"\n+\tfi\n+}\n+\n+test_ln_s () {\n+\tif test_have_prereq SYMLINKS\n+\tthen\n+\t\tln -s \"$1\" \"$2\"\n+\telse\n+\t\tprintf '%s' \"$1\" >\"$2\"\n+\tfi\n+}\n-- \n1.8.3.rc1.32.g8b61cbb\n"},{"id":"219127","messageId":"3c8aaaa4ad606d2afb7c110a28c119792caa8aba.1370076477.git.j6t@kdbg.org","threadId":"34006","inReplyTo":"cover.1370076477.git.j6t@kdbg.org","subject":"[PATCH 05/11] tests: use test_ln_s_add to remove SYMLINKS prerequisite (trivial cases)","fromName":"Johannes Sixt","fromEmail":"j6t@kdbg.org","sentAt":"2013-06-01T09:34:24Z","receivedAt":"2013-06-01T09:34:24Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"There are many instances where the treatment of symbolic links in the\nobject model and the algorithms are tested, but where it is not\nnecessary to actually have a symbolic link in the worktree. Make\nadjustments to the tests and remove the SYMLINKS prerequisite when\nappropriate in trivial cases, where \"trivial\" means:\n\n- merely a replacement of 'ln -s a b' to test_ln_s or of\n  'ln -s a b && git add b' to test_ln_s_add is needed;\n\n- a test for symbolic link on the file system can be split off (and\n  remains protected by SYMLINKS);\n\n- existing code is equivalent to test_ln_s[_add].\n\nSigned-off-by: Johannes Sixt <j6t@kdbg.org>\n---\nThe changes in t9500-gitweb-* were not tested on a system that does not\nhave SYMLINKS.\n\n t/t1004-read-tree-m-u-wf.sh            |  7 +++---\n t/t2001-checkout-cache-clash.sh        |  7 +++---\n t/t2003-checkout-cache-mkdir.sh        |  8 +++----\n t/t2004-checkout-cache-temp.sh         |  5 ++---\n t/t2007-checkout-symlink.sh            | 12 +++++------\n t/t2021-checkout-overwrite.sh          | 12 +++++++----\n t/t2200-add-update.sh                  |  5 ++---\n t/t3000-ls-files-others.sh             |  7 +-----\n t/t3010-ls-files-killed-modified.sh    | 19 ++++-------------\n t/t3700-add.sh                         | 15 ++++++-------\n t/t3903-stash.sh                       | 39 ++++++++++++++++++++++++----------\n t/t4008-diff-break-rewrite.sh          | 12 +++++------\n t/t4011-diff-symlink.sh                | 23 +++++++++++---------\n t/t4030-diff-textconv.sh               |  8 +++----\n t/t4115-apply-symlink.sh               | 10 ++++-----\n t/t4122-apply-symlink-inside.sh        |  8 +++----\n t/t7001-mv.sh                          | 18 ++++++++++------\n t/t7607-merge-overwrite.sh             |  5 ++---\n t/t8006-blame-textconv.sh              | 14 +++++-------\n t/t8007-cat-file-textconv.sh           | 10 ++++-----\n t/t9350-fast-export.sh                 |  5 ++---\n t/t9500-gitweb-standalone-no-errors.sh | 15 +++++--------\n 22 files changed, 126 insertions(+), 138 deletions(-)\n\ndiff --git a/t/t1004-read-tree-m-u-wf.sh b/t/t1004-read-tree-m-u-wf.sh\nindex b3ae7d5..3e72aff 100755\n--- a/t/t1004-read-tree-m-u-wf.sh\n+++ b/t/t1004-read-tree-m-u-wf.sh\n@@ -158,7 +158,7 @@ test_expect_success '3-way not overwriting local changes (their side)' '\n \n '\n \n-test_expect_success SYMLINKS 'funny symlink in work tree' '\n+test_expect_success 'funny symlink in work tree' '\n \n \tgit reset --hard &&\n \tgit checkout -b sym-b side-b &&\n@@ -170,15 +170,14 @@ test_expect_success SYMLINKS 'funny symlink in work tree' '\n \trm -fr a &&\n \tgit checkout -b sym-a side-a &&\n \tmkdir -p a &&\n-\tln -s ../b a/b &&\n-\tgit add a/b &&\n+\ttest_ln_s_add ../b a/b &&\n \tgit commit -m \"we add a/b\" &&\n \n \tread_tree_u_must_succeed -m -u sym-a sym-a sym-b\n \n '\n \n-test_expect_success SYMLINKS,SANITY 'funny symlink in work tree, un-unlink-able' '\n+test_expect_success SANITY 'funny symlink in work tree, un-unlink-able' '\n \n \trm -fr a b &&\n \tgit reset --hard &&\ndiff --git a/t/t2001-checkout-cache-clash.sh b/t/t2001-checkout-cache-clash.sh\nindex 98aa73e..1fc8e63 100755\n--- a/t/t2001-checkout-cache-clash.sh\n+++ b/t/t2001-checkout-cache-clash.sh\n@@ -59,10 +59,9 @@ test_expect_success \\\n     'git read-tree -m $tree1 && git checkout-index -f -a'\n test_debug 'show_files $tree1'\n \n-test_expect_success SYMLINKS \\\n-    'git update-index --add a symlink.' \\\n-    'ln -s path0 path1 &&\n-     git update-index --add path1'\n+test_expect_success \\\n+    'add a symlink' \\\n+    'test_ln_s_add path0 path1'\n test_expect_success \\\n     'writing tree out with git write-tree' \\\n     'tree3=$(git write-tree)'\ndiff --git a/t/t2003-checkout-cache-mkdir.sh b/t/t2003-checkout-cache-mkdir.sh\nindex ff163cf..bd17ba2 100755\n--- a/t/t2003-checkout-cache-mkdir.sh\n+++ b/t/t2003-checkout-cache-mkdir.sh\n@@ -19,10 +19,10 @@ test_expect_success 'setup' '\n \tgit update-index --add path0 path1/file1\n '\n \n-test_expect_success SYMLINKS 'have symlink in place where dir is expected.' '\n+test_expect_success 'have symlink in place where dir is expected.' '\n \trm -fr path0 path1 &&\n \tmkdir path2 &&\n-\tln -s path2 path1 &&\n+\ttest_ln_s path2 path1 &&\n \tgit checkout-index -f -a &&\n \ttest ! -h path1 && test -d path1 &&\n \ttest -f path1/file1 && test ! -f path2/file1\n@@ -79,10 +79,10 @@ test_expect_success SYMLINKS 'use --prefix=tmp/orary- where tmp is a symlink' '\n \ttest -h tmp\n '\n \n-test_expect_success SYMLINKS 'use --prefix=tmp- where tmp-path1 is a symlink' '\n+test_expect_success 'use --prefix=tmp- where tmp-path1 is a symlink' '\n \trm -fr path0 path1 path2 tmp* &&\n \tmkdir tmp1 &&\n-\tln -s tmp1 tmp-path1 &&\n+\ttest_ln_s tmp1 tmp-path1 &&\n \tgit checkout-index --prefix=tmp- -f -a &&\n \ttest -f tmp-path0 &&\n \ttest ! -h tmp-path1 &&\ndiff --git a/t/t2004-checkout-cache-temp.sh b/t/t2004-checkout-cache-temp.sh\nindex 0f4b289..f171a55 100755\n--- a/t/t2004-checkout-cache-temp.sh\n+++ b/t/t2004-checkout-cache-temp.sh\n@@ -194,11 +194,10 @@ test_expect_success \\\n  test $(cat ../$s1) = tree1asubdir/path5)\n )'\n \n-test_expect_success SYMLINKS \\\n+test_expect_success \\\n 'checkout --temp symlink' '\n rm -f path* .merge_* out .git/index &&\n-ln -s b a &&\n-git update-index --add a &&\n+test_ln_s_add b a &&\n t4=$(git write-tree) &&\n rm -f .git/index &&\n git read-tree $t4 &&\ndiff --git a/t/t2007-checkout-symlink.sh b/t/t2007-checkout-symlink.sh\nindex e6f59f1..fc9aad5 100755\n--- a/t/t2007-checkout-symlink.sh\n+++ b/t/t2007-checkout-symlink.sh\n@@ -6,7 +6,7 @@ test_description='git checkout to switch between branches with symlink<->dir'\n \n . ./test-lib.sh\n \n-test_expect_success SYMLINKS setup '\n+test_expect_success setup '\n \n \tmkdir frotz &&\n \techo hello >frotz/filfre &&\n@@ -25,25 +25,25 @@ test_expect_success SYMLINKS setup '\n \n \tgit rm --cached frotz/filfre &&\n \tmv frotz xyzzy &&\n-\tln -s xyzzy frotz &&\n-\tgit add xyzzy/filfre frotz &&\n+\ttest_ln_s_add xyzzy frotz &&\n+\tgit add xyzzy/filfre &&\n \ttest_tick &&\n \tgit commit -m \"side moves frotz/ to xyzzy/ and adds frotz->xyzzy/\"\n \n '\n \n-test_expect_success SYMLINKS 'switch from symlink to dir' '\n+test_expect_success 'switch from symlink to dir' '\n \n \tgit checkout master\n \n '\n \n-test_expect_success SYMLINKS 'Remove temporary directories & switch to master' '\n+test_expect_success 'Remove temporary directories & switch to master' '\n \trm -fr frotz xyzzy nitfol &&\n \tgit checkout -f master\n '\n \n-test_expect_success SYMLINKS 'switch from dir to symlink' '\n+test_expect_success 'switch from dir to symlink' '\n \n \tgit checkout side\n \ndiff --git a/t/t2021-checkout-overwrite.sh b/t/t2021-checkout-overwrite.sh\nindex 5da63e9..c2ada7d 100755\n--- a/t/t2021-checkout-overwrite.sh\n+++ b/t/t2021-checkout-overwrite.sh\n@@ -29,21 +29,25 @@ test_expect_success 'checkout commit with dir must not remove untracked a/b' '\n \ttest -f a/b\n '\n \n-test_expect_success SYMLINKS 'create a commit where dir a/b changed to symlink' '\n+test_expect_success 'create a commit where dir a/b changed to symlink' '\n \n \trm -rf a/b &&\t# cleanup if previous test failed\n \tgit checkout -f -b symlink start &&\n \trm -rf a/b &&\n-\tln -s foo a/b &&\n \tgit add -A &&\n+\ttest_ln_s_add foo a/b &&\n \tgit commit -m \"dir to symlink\"\n '\n \n-test_expect_success SYMLINKS 'checkout commit with dir must not remove untracked a/b' '\n+test_expect_success 'checkout commit with dir must not remove untracked a/b' '\n \n \tgit rm --cached a/b &&\n \tgit commit -m \"un-track the symlink\" &&\n-\ttest_must_fail git checkout start &&\n+\ttest_must_fail git checkout start\n+'\n+\n+test_expect_success SYMLINKS 'the symlink remained' '\n+\n \ttest -h a/b\n '\n \ndiff --git a/t/t2200-add-update.sh b/t/t2200-add-update.sh\nindex b2bd419..9bf2bdf 100755\n--- a/t/t2200-add-update.sh\n+++ b/t/t2200-add-update.sh\n@@ -96,11 +96,10 @@ test_expect_success 'non-limited update in subdir leaves root alone' '\n \ttest_cmp expect actual\n '\n \n-test_expect_success SYMLINKS 'replace a file with a symlink' '\n+test_expect_success 'replace a file with a symlink' '\n \n \trm foo &&\n-\tln -s top foo &&\n-\tgit add -u -- foo\n+\ttest_ln_s_add top foo\n \n '\n \ndiff --git a/t/t3000-ls-files-others.sh b/t/t3000-ls-files-others.sh\nindex 88be904..563ac7f 100755\n--- a/t/t3000-ls-files-others.sh\n+++ b/t/t3000-ls-files-others.sh\n@@ -19,12 +19,7 @@ filesystem.\n \n test_expect_success 'setup ' '\n \tdate >path0 &&\n-\tif test_have_prereq SYMLINKS\n-\tthen\n-\t\tln -s xyzzy path1\n-\telse\n-\t\tdate >path1\n-\tfi &&\n+\ttest_ln_s xyzzy path1 &&\n \tmkdir path2 path3 path4 &&\n \tdate >path2/file2 &&\n \tdate >path2-junk &&\ndiff --git a/t/t3010-ls-files-killed-modified.sh b/t/t3010-ls-files-killed-modified.sh\nindex 2d0ff2d..310e0a2 100755\n--- a/t/t3010-ls-files-killed-modified.sh\n+++ b/t/t3010-ls-files-killed-modified.sh\n@@ -39,12 +39,7 @@ modified without reporting path9 and path10.\n \n test_expect_success 'git update-index --add to add various paths.' '\n \tdate >path0 &&\n-\tif test_have_prereq SYMLINKS\n-\tthen\n-\t\tln -s xyzzy path1\n-\telse\n-\t\tdate > path1\n-\tfi &&\n+\ttest_ln_s_add xyzzy path1 &&\n \tmkdir path2 path3 &&\n \tdate >path2/file2 &&\n \tdate >path3/file3 &&\n@@ -52,20 +47,14 @@ test_expect_success 'git update-index --add to add various paths.' '\n \tdate >path8 &&\n \t: >path9 &&\n \tdate >path10 &&\n-\tgit update-index --add -- path0 path1 path?/file? path7 path8 path9 path10 &&\n+\tgit update-index --add -- path0 path?/file? path7 path8 path9 path10 &&\n \trm -fr path?\t# leave path10 alone\n '\n \n test_expect_success 'git ls-files -k to show killed files.' '\n \tdate >path2 &&\n-\tif test_have_prereq SYMLINKS\n-\tthen\n-\t\tln -s frotz path3 &&\n-\t\tln -s nitfol path5\n-\telse\n-\t\tdate >path3 &&\n-\t\tdate >path5\n-\tfi &&\n+\ttest_ln_s frotz path3 &&\n+\ttest_ln_s nitfol path5 &&\n \tmkdir path0 path1 path6 &&\n \tdate >path0/file0 &&\n \tdate >path1/file1 &&\ndiff --git a/t/t3700-add.sh b/t/t3700-add.sh\nindex 874b3a6..aab86e8 100755\n--- a/t/t3700-add.sh\n+++ b/t/t3700-add.sh\n@@ -30,10 +30,9 @@ test_expect_success \\\n \t *) echo fail; git ls-files --stage xfoo1; (exit 1);;\n \t esac'\n \n-test_expect_success SYMLINKS 'git add: filemode=0 should not get confused by symlink' '\n+test_expect_success 'git add: filemode=0 should not get confused by symlink' '\n \trm -f xfoo1 &&\n-\tln -s foo xfoo1 &&\n-\tgit add xfoo1 &&\n+\ttest_ln_s_add foo xfoo1 &&\n \tcase \"`git ls-files --stage xfoo1`\" in\n \t120000\" \"*xfoo1) echo pass;;\n \t*) echo fail; git ls-files --stage xfoo1; (exit 1);;\n@@ -51,21 +50,19 @@ test_expect_success \\\n \t *) echo fail; git ls-files --stage xfoo2; (exit 1);;\n \t esac'\n \n-test_expect_success SYMLINKS 'git add: filemode=0 should not get confused by symlink' '\n+test_expect_success 'git add: filemode=0 should not get confused by symlink' '\n \trm -f xfoo2 &&\n-\tln -s foo xfoo2 &&\n-\tgit update-index --add xfoo2 &&\n+\ttest_ln_s_add foo xfoo2 &&\n \tcase \"`git ls-files --stage xfoo2`\" in\n \t120000\" \"*xfoo2) echo pass;;\n \t*) echo fail; git ls-files --stage xfoo2; (exit 1);;\n \tesac\n '\n \n-test_expect_success SYMLINKS \\\n+test_expect_success \\\n \t'git update-index --add: Test that executable bit is not used...' \\\n \t'git config core.filemode 0 &&\n-\t ln -s xfoo2 xfoo3 &&\n-\t git update-index --add xfoo3 &&\n+\t test_ln_s_add xfoo2 xfoo3 &&\t# runs git update-index --add\n \t case \"`git ls-files --stage xfoo3`\" in\n \t 120000\" \"*xfoo3) echo pass;;\n \t *) echo fail; git ls-files --stage xfoo3; (exit 1);;\ndiff --git a/t/t3903-stash.sh b/t/t3903-stash.sh\nindex 5dfbda7..8ff039b 100755\n--- a/t/t3903-stash.sh\n+++ b/t/t3903-stash.sh\n@@ -336,41 +336,58 @@ test_expect_success SYMLINKS 'stash file to symlink (full stage)' '\n \n # This test creates a commit with a symlink used for the following tests\n \n-test_expect_success SYMLINKS 'stash symlink to file' '\n+test_expect_success 'stash symlink to file' '\n \tgit reset --hard &&\n-\tln -s file filelink &&\n-\tgit add filelink &&\n+\ttest_ln_s_add file filelink &&\n \tgit commit -m \"Add symlink\" &&\n \trm filelink &&\n \tcp file filelink &&\n-\tgit stash save \"symlink to file\" &&\n+\tgit stash save \"symlink to file\"\n+'\n+\n+test_expect_success SYMLINKS 'this must have re-created the symlink' '\n \ttest -h filelink &&\n-\tcase \"$(ls -l filelink)\" in *\" filelink -> file\") :;; *) false;; esac &&\n+\tcase \"$(ls -l filelink)\" in *\" filelink -> file\") :;; *) false;; esac\n+'\n+\n+test_expect_success 'unstash must re-create the file' '\n \tgit stash apply &&\n \t! test -h filelink &&\n \ttest bar = \"$(cat file)\"\n '\n \n-test_expect_success SYMLINKS 'stash symlink to file (stage rm)' '\n+test_expect_success 'stash symlink to file (stage rm)' '\n \tgit reset --hard &&\n \tgit rm filelink &&\n \tcp file filelink &&\n-\tgit stash save \"symlink to file (stage rm)\" &&\n+\tgit stash save \"symlink to file (stage rm)\"\n+'\n+\n+test_expect_success SYMLINKS 'this must have re-created the symlink' '\n \ttest -h filelink &&\n-\tcase \"$(ls -l filelink)\" in *\" filelink -> file\") :;; *) false;; esac &&\n+\tcase \"$(ls -l filelink)\" in *\" filelink -> file\") :;; *) false;; esac\n+'\n+\n+test_expect_success 'unstash must re-create the file' '\n \tgit stash apply &&\n \t! test -h filelink &&\n \ttest bar = \"$(cat file)\"\n '\n \n-test_expect_success SYMLINKS 'stash symlink to file (full stage)' '\n+test_expect_success 'stash symlink to file (full stage)' '\n \tgit reset --hard &&\n \trm filelink &&\n \tcp file filelink &&\n \tgit add filelink &&\n-\tgit stash save \"symlink to file (full stage)\" &&\n+\tgit stash save \"symlink to file (full stage)\"\n+'\n+\n+test_expect_success SYMLINKS 'this must have re-created the symlink' '\n \ttest -h filelink &&\n-\tcase \"$(ls -l filelink)\" in *\" filelink -> file\") :;; *) false;; esac &&\n+\tcase \"$(ls -l filelink)\" in *\" filelink -> file\") :;; *) false;; esac\n+'\n+\n+test_expect_success 'unstash must re-create the file' '\n \tgit stash apply &&\n \t! test -h filelink &&\n \ttest bar = \"$(cat file)\"\ndiff --git a/t/t4008-diff-break-rewrite.sh b/t/t4008-diff-break-rewrite.sh\nindex 73b4a24..27e98a8 100755\n--- a/t/t4008-diff-break-rewrite.sh\n+++ b/t/t4008-diff-break-rewrite.sh\n@@ -99,11 +99,11 @@ test_expect_success \\\n     'validate result of -B -M (#4)' \\\n     'compare_diff_raw expected current'\n \n-test_expect_success SYMLINKS \\\n+test_expect_success \\\n     'make file0 into something completely different' \\\n     'rm -f file0 &&\n-     ln -s frotz file0 &&\n-     git update-index file0 file1'\n+     test_ln_s_add frotz file0 &&\n+     git update-index file1'\n \n test_expect_success \\\n     'run diff with -B' \\\n@@ -114,7 +114,7 @@ cat >expected <<\\EOF\n :100644 100644 6ff87c4664981e4397625791c8ea3bbb5f2279a3 f5deac7be59e7eeab8657fd9ae706fd6a57daed2 M100\tfile1\n EOF\n \n-test_expect_success SYMLINKS \\\n+test_expect_success \\\n     'validate result of -B (#5)' \\\n     'compare_diff_raw expected current'\n \n@@ -129,7 +129,7 @@ cat >expected <<\\EOF\n :100644 100644 6ff87c4664981e4397625791c8ea3bbb5f2279a3 f5deac7be59e7eeab8657fd9ae706fd6a57daed2 R\tfile0\tfile1\n EOF\n \n-test_expect_success SYMLINKS \\\n+test_expect_success \\\n     'validate result of -B -M (#6)' \\\n     'compare_diff_raw expected current'\n \n@@ -144,7 +144,7 @@ cat >expected <<\\EOF\n :100644 100644 6ff87c4664981e4397625791c8ea3bbb5f2279a3 f5deac7be59e7eeab8657fd9ae706fd6a57daed2 M\tfile1\n EOF\n \n-test_expect_success SYMLINKS \\\n+test_expect_success \\\n     'validate result of -M (#7)' \\\n     'compare_diff_raw expected current'\n \ndiff --git a/t/t4011-diff-symlink.sh b/t/t4011-diff-symlink.sh\nindex f0d5041..3888519 100755\n--- a/t/t4011-diff-symlink.sh\n+++ b/t/t4011-diff-symlink.sh\n@@ -9,7 +9,7 @@ test_description='Test diff of symlinks.\n . ./test-lib.sh\n . \"$TEST_DIRECTORY\"/diff-lib.sh\n \n-test_expect_success SYMLINKS 'diff new symlink and file' '\n+test_expect_success 'diff new symlink and file' '\n \tcat >expected <<-\\EOF &&\n \tdiff --git a/frotz b/frotz\n \tnew file mode 120000\n@@ -27,22 +27,25 @@ test_expect_success SYMLINKS 'diff new symlink and file' '\n \t@@ -0,0 +1 @@\n \t+xyzzy\n \tEOF\n-\tln -s xyzzy frotz &&\n-\techo xyzzy >nitfol &&\n+\n+\t# the empty tree\n \tgit update-index &&\n \ttree=$(git write-tree) &&\n-\tgit update-index --add frotz nitfol &&\n+\n+\ttest_ln_s_add xyzzy frotz &&\n+\techo xyzzy >nitfol &&\n+\tgit update-index --add nitfol &&\n \tGIT_DIFF_OPTS=--unified=0 git diff-index -M -p $tree >current &&\n \tcompare_diff_patch expected current\n '\n \n-test_expect_success SYMLINKS 'diff unchanged symlink and file'  '\n+test_expect_success 'diff unchanged symlink and file'  '\n \ttree=$(git write-tree) &&\n \tgit update-index frotz nitfol &&\n \ttest -z \"$(git diff-index --name-only $tree)\"\n '\n \n-test_expect_success SYMLINKS 'diff removed symlink and file' '\n+test_expect_success 'diff removed symlink and file' '\n \tcat >expected <<-\\EOF &&\n \tdiff --git a/frotz b/frotz\n \tdeleted file mode 120000\n@@ -66,12 +69,12 @@ test_expect_success SYMLINKS 'diff removed symlink and file' '\n \tcompare_diff_patch expected current\n '\n \n-test_expect_success SYMLINKS 'diff identical, but newly created symlink and file' '\n+test_expect_success 'diff identical, but newly created symlink and file' '\n \t>expected &&\n \trm -f frotz nitfol &&\n \techo xyzzy >nitfol &&\n \ttest-chmtime +10 nitfol &&\n-\tln -s xyzzy frotz &&\n+\ttest_ln_s xyzzy frotz &&\n \tgit diff-index -M -p $tree >current &&\n \tcompare_diff_patch expected current &&\n \n@@ -80,7 +83,7 @@ test_expect_success SYMLINKS 'diff identical, but newly created symlink and file\n \tcompare_diff_patch expected current\n '\n \n-test_expect_success SYMLINKS 'diff different symlink and file' '\n+test_expect_success 'diff different symlink and file' '\n \tcat >expected <<-\\EOF &&\n \tdiff --git a/frotz b/frotz\n \tindex 7c465af..df1db54 120000\n@@ -100,7 +103,7 @@ test_expect_success SYMLINKS 'diff different symlink and file' '\n \t+yxyyz\n \tEOF\n \trm -f frotz &&\n-\tln -s yxyyz frotz &&\n+\ttest_ln_s yxyyz frotz &&\n \techo yxyyz >nitfol &&\n \tgit diff-index -M -p $tree >current &&\n \tcompare_diff_patch expected current\ndiff --git a/t/t4030-diff-textconv.sh b/t/t4030-diff-textconv.sh\nindex 53ec330..f75f46f 100755\n--- a/t/t4030-diff-textconv.sh\n+++ b/t/t4030-diff-textconv.sh\n@@ -139,12 +139,10 @@ index 0000000..67be421\n +frotz\n \\ No newline at end of file\n EOF\n-# make a symlink the hard way that works on symlink-challenged file systems\n+\n test_expect_success 'textconv does not act on symlinks' '\n-\tprintf frotz > file &&\n-\tgit add file &&\n-\tgit ls-files -s | sed -e s/100644/120000/ |\n-\t\tgit update-index --index-info &&\n+\trm -f file &&\n+\ttest_ln_s_add frotz file &&\n \tgit commit -m typechange &&\n \tgit show >diff &&\n \tfind_diff <diff >actual &&\ndiff --git a/t/t4115-apply-symlink.sh b/t/t4115-apply-symlink.sh\nindex 7674dd2..872fcda 100755\n--- a/t/t4115-apply-symlink.sh\n+++ b/t/t4115-apply-symlink.sh\n@@ -9,18 +9,16 @@ test_description='git apply symlinks and partial files\n \n . ./test-lib.sh\n \n-test_expect_success SYMLINKS setup '\n+test_expect_success setup '\n \n-\tln -s path1/path2/path3/path4/path5 link1 &&\n-\tgit add link? &&\n+\ttest_ln_s_add path1/path2/path3/path4/path5 link1 &&\n \tgit commit -m initial &&\n \n \tgit branch side &&\n \n \trm -f link? &&\n \n-\tln -s htap6 link1 &&\n-\tgit update-index link? &&\n+\ttest_ln_s_add htap6 link1 &&\n \tgit commit -m second &&\n \n \tgit diff-tree -p HEAD^ HEAD >patch  &&\n@@ -37,7 +35,7 @@ test_expect_success SYMLINKS 'apply symlink patch' '\n \n '\n \n-test_expect_success SYMLINKS 'apply --index symlink patch' '\n+test_expect_success 'apply --index symlink patch' '\n \n \tgit checkout -f side &&\n \tgit apply --index patch &&\ndiff --git a/t/t4122-apply-symlink-inside.sh b/t/t4122-apply-symlink-inside.sh\nindex 3940737..70b3a06 100755\n--- a/t/t4122-apply-symlink-inside.sh\n+++ b/t/t4122-apply-symlink-inside.sh\n@@ -10,11 +10,11 @@ lecho () {\n \tdone\n }\n \n-test_expect_success SYMLINKS setup '\n+test_expect_success setup '\n \n \tmkdir -p arch/i386/boot arch/x86_64 &&\n \tlecho 1 2 3 4 5 >arch/i386/boot/Makefile &&\n-\tln -s ../i386/boot arch/x86_64/boot &&\n+\ttest_ln_s_add ../i386/boot arch/x86_64/boot &&\n \tgit add . &&\n \ttest_tick &&\n \tgit commit -m initial &&\n@@ -31,7 +31,7 @@ test_expect_success SYMLINKS setup '\n \n '\n \n-test_expect_success SYMLINKS apply '\n+test_expect_success apply '\n \n \tgit checkout test &&\n \tgit diff --exit-code test &&\n@@ -40,7 +40,7 @@ test_expect_success SYMLINKS apply '\n \n '\n \n-test_expect_success SYMLINKS 'check result' '\n+test_expect_success 'check result' '\n \n \tgit diff --exit-code master &&\n \tgit diff --exit-code --cached master &&\ndiff --git a/t/t7001-mv.sh b/t/t7001-mv.sh\nindex a845b15..101816e 100755\n--- a/t/t7001-mv.sh\n+++ b/t/t7001-mv.sh\n@@ -218,13 +218,13 @@ test_expect_success 'git mv should not change sha1 of moved cache entry' '\n \n rm -f dirty dirty2\n \n-test_expect_success SYMLINKS 'git mv should overwrite symlink to a file' '\n+test_expect_success 'git mv should overwrite symlink to a file' '\n \n \trm -fr .git &&\n \tgit init &&\n \techo 1 >moved &&\n-\tln -s moved symlink &&\n-\tgit add moved symlink &&\n+\ttest_ln_s_add moved symlink &&\n+\tgit add moved &&\n \ttest_must_fail git mv moved symlink &&\n \tgit mv -f moved symlink &&\n \t! test -e moved &&\n@@ -237,22 +237,26 @@ test_expect_success SYMLINKS 'git mv should overwrite symlink to a file' '\n \n rm -f moved symlink\n \n-test_expect_success SYMLINKS 'git mv should overwrite file with a symlink' '\n+test_expect_success 'git mv should overwrite file with a symlink' '\n \n \trm -fr .git &&\n \tgit init &&\n \techo 1 >moved &&\n-\tln -s moved symlink &&\n-\tgit add moved symlink &&\n+\ttest_ln_s_add moved symlink &&\n+\tgit add moved &&\n \ttest_must_fail git mv symlink moved &&\n \tgit mv -f symlink moved &&\n \t! test -e symlink &&\n-\ttest -h moved &&\n \tgit update-index --refresh &&\n \tgit diff-files --quiet\n \n '\n \n+test_expect_success SYMLINKS 'check moved symlink' '\n+\n+\ttest -h moved\n+'\n+\n rm -f moved symlink\n \n test_done\ndiff --git a/t/t7607-merge-overwrite.sh b/t/t7607-merge-overwrite.sh\nindex 6547eb8..758a623 100755\n--- a/t/t7607-merge-overwrite.sh\n+++ b/t/t7607-merge-overwrite.sh\n@@ -141,11 +141,10 @@ test_expect_success SYMLINKS 'will not overwrite untracked symlink in leading pa\n \ttest_path_is_missing .git/MERGE_HEAD\n '\n \n-test_expect_success SYMLINKS 'will not be confused by symlink in leading path' '\n+test_expect_success 'will not be confused by symlink in leading path' '\n \tgit reset --hard c0 &&\n \trm -rf sub &&\n-\tln -s sub2 sub &&\n-\tgit add sub &&\n+\ttest_ln_s_add sub2 sub &&\n \tgit commit -m ln &&\n \tgit checkout sub\n '\ndiff --git a/t/t8006-blame-textconv.sh b/t/t8006-blame-textconv.sh\nindex bf6caa4..7683515 100755\n--- a/t/t8006-blame-textconv.sh\n+++ b/t/t8006-blame-textconv.sh\n@@ -18,17 +18,13 @@ test_expect_success 'setup ' '\n \techo \"bin: test number 0\" >zero.bin &&\n \techo \"bin: test 1\" >one.bin &&\n \techo \"bin: test number 2\" >two.bin &&\n-\tif test_have_prereq SYMLINKS; then\n-\t\tln -s one.bin symlink.bin\n-\tfi &&\n+\ttest_ln_s_add one.bin symlink.bin &&\n \tgit add . &&\n \tGIT_AUTHOR_NAME=Number1 git commit -a -m First --date=\"2010-01-01 18:00:00\" &&\n \techo \"bin: test 1 version 2\" >one.bin &&\n \techo \"bin: test number 2 version 2\" >>two.bin &&\n-\tif test_have_prereq SYMLINKS; then\n-\t\trm symlink.bin &&\n-\t\tln -s two.bin symlink.bin\n-\tfi &&\n+\trm -f symlink.bin &&\n+\ttest_ln_s_add two.bin symlink.bin &&\n \tGIT_AUTHOR_NAME=Number2 git commit -a -m Second --date=\"2010-01-01 20:00:00\"\n '\n \n@@ -135,7 +131,7 @@ test_expect_success SYMLINKS 'blame --textconv (on symlink)' '\n \n # cp two.bin three.bin  and make small tweak\n # (this will direct blame -C -C three.bin to consider two.bin and symlink.bin)\n-test_expect_success SYMLINKS 'make another new commit' '\n+test_expect_success 'make another new commit' '\n \tcat >three.bin <<\\EOF &&\n bin: test number 2\n bin: test number 2 version 2\n@@ -146,7 +142,7 @@ EOF\n \tGIT_AUTHOR_NAME=Number4 git commit -a -m Fourth --date=\"2010-01-01 23:00:00\"\n '\n \n-test_expect_success SYMLINKS 'blame on last commit (-C -C, symlink)' '\n+test_expect_success 'blame on last commit (-C -C, symlink)' '\n \tgit blame -C -C three.bin >blame &&\n \tfind_blame <blame >result &&\n \tcat >expected <<\\EOF &&\ndiff --git a/t/t8007-cat-file-textconv.sh b/t/t8007-cat-file-textconv.sh\nindex 78a0085..b95e102 100755\n--- a/t/t8007-cat-file-textconv.sh\n+++ b/t/t8007-cat-file-textconv.sh\n@@ -12,9 +12,7 @@ chmod +x helper\n \n test_expect_success 'setup ' '\n \techo \"bin: test\" >one.bin &&\n-\tif test_have_prereq SYMLINKS; then\n-\t\tln -s one.bin symlink.bin\n-\tfi &&\n+\ttest_ln_s_add one.bin symlink.bin &&\n \tgit add . &&\n \tGIT_AUTHOR_NAME=Number1 git commit -a -m First --date=\"2010-01-01 18:00:00\" &&\n \techo \"bin: test version 2\" >one.bin &&\n@@ -72,14 +70,14 @@ test_expect_success 'cat-file --textconv on previous commit' '\n \ttest_cmp expected result\n '\n \n-test_expect_success SYMLINKS 'cat-file without --textconv (symlink)' '\n+test_expect_success 'cat-file without --textconv (symlink)' '\n \tgit cat-file blob :symlink.bin >result &&\n \tprintf \"%s\" \"one.bin\" >expected\n \ttest_cmp expected result\n '\n \n \n-test_expect_success SYMLINKS 'cat-file --textconv on index (symlink)' '\n+test_expect_success 'cat-file --textconv on index (symlink)' '\n \t! git cat-file --textconv :symlink.bin 2>result &&\n \tcat >expected <<\\EOF &&\n fatal: git cat-file --textconv: unable to run textconv on :symlink.bin\n@@ -87,7 +85,7 @@ EOF\n \ttest_cmp expected result\n '\n \n-test_expect_success SYMLINKS 'cat-file --textconv on HEAD (symlink)' '\n+test_expect_success 'cat-file --textconv on HEAD (symlink)' '\n \t! git cat-file --textconv HEAD:symlink.bin 2>result &&\n \tcat >expected <<EOF &&\n fatal: git cat-file --textconv: unable to run textconv on HEAD:symlink.bin\ndiff --git a/t/t9350-fast-export.sh b/t/t9350-fast-export.sh\nindex 2471bc6..34c2d8f 100755\n--- a/t/t9350-fast-export.sh\n+++ b/t/t9350-fast-export.sh\n@@ -396,7 +396,7 @@ test_expect_success 'tree_tag-obj'    'git fast-export tree_tag-obj'\n test_expect_success 'tag-obj_tag'     'git fast-export tag-obj_tag'\n test_expect_success 'tag-obj_tag-obj' 'git fast-export tag-obj_tag-obj'\n \n-test_expect_success SYMLINKS 'directory becomes symlink'        '\n+test_expect_success 'directory becomes symlink'        '\n \tgit init dirtosymlink &&\n \tgit init result &&\n \t(\n@@ -408,8 +408,7 @@ test_expect_success SYMLINKS 'directory becomes symlink'        '\n \t\tgit add foo/world bar/world &&\n \t\tgit commit -q -mone &&\n \t\tgit rm -r foo &&\n-\t\tln -s bar foo &&\n-\t\tgit add foo &&\n+\t\ttest_ln_s_add bar foo &&\n \t\tgit commit -q -mtwo\n \t) &&\n \t(\ndiff --git a/t/t9500-gitweb-standalone-no-errors.sh b/t/t9500-gitweb-standalone-no-errors.sh\nindex 6783c14..6fca193 100755\n--- a/t/t9500-gitweb-standalone-no-errors.sh\n+++ b/t/t9500-gitweb-standalone-no-errors.sh\n@@ -156,10 +156,10 @@ test_expect_success \\\n \t git commit -a -m \"File renamed.\" &&\n \t gitweb_run \"p=.git;a=commitdiff\"'\n \n-test_expect_success SYMLINKS \\\n+test_expect_success \\\n \t'commitdiff(0): file to symlink' \\\n \t'rm renamed_file &&\n-\t ln -s file renamed_file &&\n+\t test_ln_s_add file renamed_file &&\n \t git commit -a -m \"File to symlink.\" &&\n \t gitweb_run \"p=.git;a=commitdiff\"'\n \n@@ -212,15 +212,14 @@ test_expect_success \\\n # ----------------------------------------------------------------------\n # commitdiff testing (taken from t4114-apply-typechange.sh)\n \n-test_expect_success SYMLINKS 'setup typechange commits' '\n+test_expect_success 'setup typechange commits' '\n \techo \"hello world\" > foo &&\n \techo \"hi planet\" > bar &&\n \tgit update-index --add foo bar &&\n \tgit commit -m initial &&\n \tgit branch initial &&\n \trm -f foo &&\n-\tln -s bar foo &&\n-\tgit update-index foo &&\n+\ttest_ln_s_add bar foo &&\n \tgit commit -m \"foo symlinked to bar\" &&\n \tgit branch foo-symlinked-to-bar &&\n \trm -f foo &&\n@@ -361,11 +360,7 @@ test_expect_success \\\n \t echo \"Changed\" >> 04-rename-to &&\n \t test_chmod +x 05-mode-change &&\n \t rm -f 06-file-or-symlink &&\n-\t if test_have_prereq SYMLINKS; then\n-\t\tln -s 01-change 06-file-or-symlink\n-\t else\n-\t\tprintf %s 01-change > 06-file-or-symlink\n-\t fi &&\n+\t test_ln_s_add 01-change 06-file-or-symlink &&\n \t echo \"Changed and have mode changed\" > 07-change-mode-change\t&&\n \t test_chmod +x 07-change-mode-change &&\n \t git commit -a -m \"Large commit\" &&\n-- \n1.8.3.rc1.32.g8b61cbb\n"},{"id":"219123","messageId":"814f331a06a4bef4bf28d5f84ef9722ccf5f5420.1370076477.git.j6t@kdbg.org","threadId":"34006","inReplyTo":"cover.1370076477.git.j6t@kdbg.org","subject":"[PATCH 06/11] t0000: use test_ln_s_add to remove SYMLINKS prerequisite","fromName":"Johannes Sixt","fromEmail":"j6t@kdbg.org","sentAt":"2013-06-01T09:34:25Z","receivedAt":"2013-06-01T09:34:25Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"t0000-basic hard-codes many object IDs. To cater to file systems that do\nnot support symbolic links, different IDs are used depending on the\nSYMLINKS prerequisite. But we can observe the symbolic links are only\nneeded to generate index entries. Use test_ln_s_add to generate the\nindex entries and get rid of explicit SYMLINKS checks.\n\nThis undoes the special casing introduced in this test by 704a3143\n(Use prerequisite tags to skip tests that depend on symbolic links,\n2009-03-04).\n\nSigned-off-by: Johannes Sixt <j6t@kdbg.org>\n---\n t/t0000-basic.sh | 39 ++++++++++-----------------------------\n 1 file changed, 10 insertions(+), 29 deletions(-)\n\ndiff --git a/t/t0000-basic.sh b/t/t0000-basic.sh\nindex cefe33d..0f13180 100755\n--- a/t/t0000-basic.sh\n+++ b/t/t0000-basic.sh\n@@ -367,22 +367,6 @@ test_expect_success 'validate object ID of a known tree' '\n \n # Various types of objects\n \n-# Some filesystems do not support symblic links; on such systems\n-# some expected values are different\n-if test_have_prereq SYMLINKS\n-then\n-\texpectfilter=cat\n-\texpectedtree=087704a96baf1c2d1c869a8b084481e121c88b5b\n-\texpectedptree1=21ae8269cacbe57ae09138dcc3a2887f904d02b3\n-\texpectedptree2=3c5e5399f3a333eddecce7a9b9465b63f65f51e2\n-else\n-\texpectfilter='grep -v sym'\n-\texpectedtree=8e18edf7d7edcf4371a3ac6ae5f07c2641db7c46\n-\texpectedptree1=cfb8591b2f65de8b8cc1020cd7d9e67e7793b325\n-\texpectedptree2=ce580448f0148b985a513b693fdf7d802cacb44f\n-fi\n-\n-\n test_expect_success 'adding various types of objects with git update-index --add' '\n \tmkdir path2 path3 path3/subp3 &&\n \tpaths=\"path0 path2/file2 path3/file3 path3/subp3/file3\" &&\n@@ -390,10 +374,7 @@ test_expect_success 'adding various types of objects with git update-index --add\n \t\tfor p in $paths\n \t\tdo\n \t\t\techo \"hello $p\" >$p || exit 1\n-\t\t\tif test_have_prereq SYMLINKS\n-\t\t\tthen\n-\t\t\t\tln -s \"hello $p\" ${p}sym || exit 1\n-\t\t\tfi\n+\t\t\ttest_ln_s_add \"hello $p\" ${p}sym || exit 1\n \t\tdone\n \t) &&\n \tfind path* ! -type d -print | xargs git update-index --add\n@@ -405,7 +386,7 @@ test_expect_success 'showing stage with git ls-files --stage' '\n '\n \n test_expect_success 'validate git ls-files output for a known tree' '\n-\t$expectfilter >expected <<-\\EOF &&\n+\tcat >expected <<-\\EOF &&\n \t100644 f87290f8eb2cbbea7857214459a0739927eab154 0\tpath0\n \t120000 15a98433ae33114b085f3eb3bb03b832b3180a01 0\tpath0sym\n \t100644 3feff949ed00a62d9f7af97c15cd8a30595e7ac7 0\tpath2/file2\n@@ -423,14 +404,14 @@ test_expect_success 'writing tree out with git write-tree' '\n '\n \n test_expect_success 'validate object ID for a known tree' '\n-\ttest \"$tree\" = \"$expectedtree\"\n+\ttest \"$tree\" = 087704a96baf1c2d1c869a8b084481e121c88b5b\n '\n \n test_expect_success 'showing tree with git ls-tree' '\n     git ls-tree $tree >current\n '\n \n-test_expect_success SYMLINKS 'git ls-tree output for a known tree' '\n+test_expect_success 'git ls-tree output for a known tree' '\n \tcat >expected <<-\\EOF &&\n \t100644 blob f87290f8eb2cbbea7857214459a0739927eab154\tpath0\n \t120000 blob 15a98433ae33114b085f3eb3bb03b832b3180a01\tpath0sym\n@@ -447,7 +428,7 @@ test_expect_success 'showing tree with git ls-tree -r' '\n '\n \n test_expect_success 'git ls-tree -r output for a known tree' '\n-\t$expectfilter >expected <<-\\EOF &&\n+\tcat >expected <<-\\EOF &&\n \t100644 blob f87290f8eb2cbbea7857214459a0739927eab154\tpath0\n \t120000 blob 15a98433ae33114b085f3eb3bb03b832b3180a01\tpath0sym\n \t100644 blob 3feff949ed00a62d9f7af97c15cd8a30595e7ac7\tpath2/file2\n@@ -465,7 +446,7 @@ test_expect_success 'showing tree with git ls-tree -r -t' '\n \tgit ls-tree -r -t $tree >current\n '\n \n-test_expect_success SYMLINKS 'git ls-tree -r output for a known tree' '\n+test_expect_success 'git ls-tree -r output for a known tree' '\n \tcat >expected <<-\\EOF &&\n \t100644 blob f87290f8eb2cbbea7857214459a0739927eab154\tpath0\n \t120000 blob 15a98433ae33114b085f3eb3bb03b832b3180a01\tpath0sym\n@@ -487,7 +468,7 @@ test_expect_success 'writing partial tree out with git write-tree --prefix' '\n '\n \n test_expect_success 'validate object ID for a known tree' '\n-\ttest \"$ptree\" = \"$expectedptree1\"\n+\ttest \"$ptree\" = 21ae8269cacbe57ae09138dcc3a2887f904d02b3\n '\n \n test_expect_success 'writing partial tree out with git write-tree --prefix' '\n@@ -495,7 +476,7 @@ test_expect_success 'writing partial tree out with git write-tree --prefix' '\n '\n \n test_expect_success 'validate object ID for a known tree' '\n-\ttest \"$ptree\" = \"$expectedptree2\"\n+\ttest \"$ptree\" = 3c5e5399f3a333eddecce7a9b9465b63f65f51e2\n '\n \n test_expect_success 'put invalid objects into the index' '\n@@ -529,7 +510,7 @@ test_expect_success 'git read-tree followed by write-tree should be idempotent'\n '\n \n test_expect_success 'validate git diff-files output for a know cache/work tree state' '\n-\t$expectfilter >expected <<\\EOF &&\n+\tcat >expected <<\\EOF &&\n :100644 100644 f87290f8eb2cbbea7857214459a0739927eab154 0000000000000000000000000000000000000000 M\tpath0\n :120000 120000 15a98433ae33114b085f3eb3bb03b832b3180a01 0000000000000000000000000000000000000000 M\tpath0sym\n :100644 100644 3feff949ed00a62d9f7af97c15cd8a30595e7ac7 0000000000000000000000000000000000000000 M\tpath2/file2\n@@ -553,7 +534,7 @@ test_expect_success 'no diff after checkout and git update-index --refresh' '\n '\n \n ################################################################\n-P=$expectedtree\n+P=087704a96baf1c2d1c869a8b084481e121c88b5b\n \n test_expect_success 'git commit-tree records the correct tree in a commit' '\n \tcommit0=$(echo NO | git commit-tree $P) &&\n-- \n1.8.3.rc1.32.g8b61cbb\n"},{"id":"219122","messageId":"e232ae3efc6f7b282d4402e6e6976b34d34ab3e7.1370076477.git.j6t@kdbg.org","threadId":"34006","inReplyTo":"cover.1370076477.git.j6t@kdbg.org","subject":"[PATCH 07/11] t2100: use test_ln_s_add to remove SYMLINKS prerequisite","fromName":"Johannes Sixt","fromEmail":"j6t@kdbg.org","sentAt":"2013-06-01T09:34:26Z","receivedAt":"2013-06-01T09:34:26Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"One converted case expects 'git update-index' to fail. We cannot use\n'test_must_fail test_ln_s_add ...', because that would mistakenly pass\nif a command other than the final git-update-index of test_ln_s_add\nfailed. Hence, use test_ln_s to create the symbolic link and keep\nthe explicit 'test_must_fail git update-index'.\n\nSigned-off-by: Johannes Sixt <j6t@kdbg.org>\n---\n t/t2100-update-cache-badpath.sh | 14 ++------------\n 1 file changed, 2 insertions(+), 12 deletions(-)\n\ndiff --git a/t/t2100-update-cache-badpath.sh b/t/t2100-update-cache-badpath.sh\nindex a3f9255..47a9b05 100755\n--- a/t/t2100-update-cache-badpath.sh\n+++ b/t/t2100-update-cache-badpath.sh\n@@ -28,12 +28,7 @@ test_expect_success 'git update-index --add to add various paths' '\n \n \tmkdir path2 path3 &&\n \tdate >path0 &&\n-\tif test_have_prereq SYMLINKS\n-\tthen\n-\t\tln -s xyzzy path1\n-\telse\n-\t\tdate >path1\n-\tfi &&\n+\ttest_ln_s_add xyzzy path1 &&\n \tdate >path2/file2 &&\n \tdate >path3/file3 &&\n \ttest_when_finished \"rm -fr path0 path1 path2 path3\" &&\n@@ -62,12 +57,7 @@ test_expect_success 'git update-index to add conflicting file path2 should fail'\n \n test_expect_success 'git update-index to add conflicting symlink path3 should fail' '\n \n-\tif test_have_prereq SYMLINKS\n-\tthen\n-\t\tln -s xyzzy path3\n-\telse\n-\t\tdate >path3\n-\tfi &&\n+\ttest_ln_s xyzzy path3 &&\n \ttest_must_fail git update-index --add -- path3\n '\n \n-- \n1.8.3.rc1.32.g8b61cbb\n"},{"id":"219119","messageId":"4af20d7b181e9c5eadb00cb2b6e349161901bbb8.1370076477.git.j6t@kdbg.org","threadId":"34006","inReplyTo":"cover.1370076477.git.j6t@kdbg.org","subject":"[PATCH 08/11] t3030: use test_ln_s_add to remove SYMLINKS prerequisite","fromName":"Johannes Sixt","fromEmail":"j6t@kdbg.org","sentAt":"2013-06-01T09:34:27Z","receivedAt":"2013-06-01T09:34:27Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"The test cases include many corner-cases of merge-recursive's behavior,\nsome of them involve type changes and symbolic links. All cases, including\nthose that are protected by SYMLINKS check only whether the result of\nmerge-recursive is correctly stored in the database and the index; the\nfile system is not investigated. Use test_ln_s_add to enter a symbolic\nlink in the index in the test setup and run the tests without the\nSYMLINKS prerequisite.\n\nNotice that one test that has the SYMLINKS protection removed is an\nexpect_failure. There is a possibility that the test fails differently\ndepending on whether SYMLINKS is present or not; but this is not the case\npresently.\n\nSigned-off-by: Johannes Sixt <j6t@kdbg.org>\n---\n t/t3030-merge-recursive.sh | 62 +++++++++++++++++++---------------------------\n 1 file changed, 26 insertions(+), 36 deletions(-)\n\ndiff --git a/t/t3030-merge-recursive.sh b/t/t3030-merge-recursive.sh\nindex a5e3da7..2f96100 100755\n--- a/t/t3030-merge-recursive.sh\n+++ b/t/t3030-merge-recursive.sh\n@@ -25,10 +25,7 @@ test_expect_success 'setup 1' '\n \tgit branch submod &&\n \tgit branch copy &&\n \tgit branch rename &&\n-\tif test_have_prereq SYMLINKS\n-\tthen\n-\t\tgit branch rename-ln\n-\tfi &&\n+\tgit branch rename-ln &&\n \n \techo hello >>a &&\n \tcp a d/e &&\n@@ -260,16 +257,12 @@ test_expect_success 'setup 8' '\n \tgit add e &&\n \ttest_tick &&\n \tgit commit -m \"rename a->e\" &&\n-\tif test_have_prereq SYMLINKS\n-\tthen\n-\t\tgit checkout rename-ln &&\n-\t\tgit mv a e &&\n-\t\tln -s e a &&\n-\t\tgit add a e &&\n-\t\ttest_tick &&\n-\t\tgit commit -m \"rename a->e, symlink a->e\" &&\n-\t\toln=`printf e | git hash-object --stdin`\n-\tfi\n+\tgit checkout rename-ln &&\n+\tgit mv a e &&\n+\ttest_ln_s_add e a &&\n+\ttest_tick &&\n+\tgit commit -m \"rename a->e, symlink a->e\" &&\n+\toln=`printf e | git hash-object --stdin`\n '\n \n test_expect_success 'setup 9' '\n@@ -569,28 +562,25 @@ test_expect_success 'merge-recursive copy vs. rename' '\n \ttest_cmp expected actual\n '\n \n-if test_have_prereq SYMLINKS\n-then\n-\ttest_expect_failure 'merge-recursive rename vs. rename/symlink' '\n-\n-\t\tgit checkout -f rename &&\n-\t\tgit merge rename-ln &&\n-\t\t( git ls-tree -r HEAD ; git ls-files -s ) >actual &&\n-\t\t(\n-\t\t\techo \"120000 blob $oln\ta\"\n-\t\t\techo \"100644 blob $o0\tb\"\n-\t\t\techo \"100644 blob $o0\tc\"\n-\t\t\techo \"100644 blob $o0\td/e\"\n-\t\t\techo \"100644 blob $o0\te\"\n-\t\t\techo \"120000 $oln 0\ta\"\n-\t\t\techo \"100644 $o0 0\tb\"\n-\t\t\techo \"100644 $o0 0\tc\"\n-\t\t\techo \"100644 $o0 0\td/e\"\n-\t\t\techo \"100644 $o0 0\te\"\n-\t\t) >expected &&\n-\t\ttest_cmp expected actual\n-\t'\n-fi\n+test_expect_failure 'merge-recursive rename vs. rename/symlink' '\n+\n+\tgit checkout -f rename &&\n+\tgit merge rename-ln &&\n+\t( git ls-tree -r HEAD ; git ls-files -s ) >actual &&\n+\t(\n+\t\techo \"120000 blob $oln\ta\"\n+\t\techo \"100644 blob $o0\tb\"\n+\t\techo \"100644 blob $o0\tc\"\n+\t\techo \"100644 blob $o0\td/e\"\n+\t\techo \"100644 blob $o0\te\"\n+\t\techo \"120000 $oln 0\ta\"\n+\t\techo \"100644 $o0 0\tb\"\n+\t\techo \"100644 $o0 0\tc\"\n+\t\techo \"100644 $o0 0\td/e\"\n+\t\techo \"100644 $o0 0\te\"\n+\t) >expected &&\n+\ttest_cmp expected actual\n+'\n \n \n test_done\n-- \n1.8.3.rc1.32.g8b61cbb\n"},{"id":"219120","messageId":"4cc6378373fe8c0002c22a65192abe82638cb6d4.1370076477.git.j6t@kdbg.org","threadId":"34006","inReplyTo":"cover.1370076477.git.j6t@kdbg.org","subject":"[PATCH 09/11] t3100: use test_ln_s_add to remove SYMLINKS prerequisite","fromName":"Johannes Sixt","fromEmail":"j6t@kdbg.org","sentAt":"2013-06-01T09:34:28Z","receivedAt":"2013-06-01T09:34:28Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"This undoes the special casing introduced in this test by 704a3143\n(Use prerequisite tags to skip tests that depend on symbolic links,\n2009-03-04).\n\nSigned-off-by: Johannes Sixt <j6t@kdbg.org>\n---\n t/t3100-ls-tree-restrict.sh | 42 +++++++++++++++---------------------------\n 1 file changed, 15 insertions(+), 27 deletions(-)\n\ndiff --git a/t/t3100-ls-tree-restrict.sh b/t/t3100-ls-tree-restrict.sh\nindex 81d90b6..eb73c06 100755\n--- a/t/t3100-ls-tree-restrict.sh\n+++ b/t/t3100-ls-tree-restrict.sh\n@@ -22,20 +22,8 @@ test_expect_success \\\n     'setup' \\\n     'mkdir path2 path2/baz &&\n      echo Hi >path0 &&\n-     if test_have_prereq SYMLINKS\n-     then\n-\tln -s path0 path1 &&\n-\tln -s ../path1 path2/bazbo\n-\tmake_expected () {\n-\t\tcat >expected\n-\t}\n-     else\n-\tprintf path0 > path1 &&\n-\tprintf ../path1 > path2/bazbo\n-\tmake_expected () {\n-\t\tsed -e \"s/120000 /100644 /\" >expected\n-\t}\n-     fi &&\n+     test_ln_s_add path0 path1 &&\n+     test_ln_s_add ../path1 path2/bazbo &&\n      echo Lo >path2/foo &&\n      echo Mi >path2/baz/b &&\n      find path? \\( -type f -o -type l \\) -print |\n@@ -51,7 +39,7 @@ test_output () {\n test_expect_success \\\n     'ls-tree plain' \\\n     'git ls-tree $tree >current &&\n-     make_expected <<\\EOF &&\n+     cat >expected <<\\EOF &&\n 100644 blob X\tpath0\n 120000 blob X\tpath1\n 040000 tree X\tpath2\n@@ -61,7 +49,7 @@ EOF\n test_expect_success \\\n     'ls-tree recursive' \\\n     'git ls-tree -r $tree >current &&\n-     make_expected <<\\EOF &&\n+     cat >expected <<\\EOF &&\n 100644 blob X\tpath0\n 120000 blob X\tpath1\n 100644 blob X\tpath2/baz/b\n@@ -73,7 +61,7 @@ EOF\n test_expect_success \\\n     'ls-tree recursive with -t' \\\n     'git ls-tree -r -t $tree >current &&\n-     make_expected <<\\EOF &&\n+     cat >expected <<\\EOF &&\n 100644 blob X\tpath0\n 120000 blob X\tpath1\n 040000 tree X\tpath2\n@@ -87,7 +75,7 @@ EOF\n test_expect_success \\\n     'ls-tree recursive with -d' \\\n     'git ls-tree -r -d $tree >current &&\n-     make_expected <<\\EOF &&\n+     cat >expected <<\\EOF &&\n 040000 tree X\tpath2\n 040000 tree X\tpath2/baz\n EOF\n@@ -96,7 +84,7 @@ EOF\n test_expect_success \\\n     'ls-tree filtered with path' \\\n     'git ls-tree $tree path >current &&\n-     make_expected <<\\EOF &&\n+     cat >expected <<\\EOF &&\n EOF\n      test_output'\n \n@@ -106,7 +94,7 @@ EOF\n test_expect_success \\\n     'ls-tree filtered with path1 path0' \\\n     'git ls-tree $tree path1 path0 >current &&\n-     make_expected <<\\EOF &&\n+     cat >expected <<\\EOF &&\n 100644 blob X\tpath0\n 120000 blob X\tpath1\n EOF\n@@ -115,7 +103,7 @@ EOF\n test_expect_success \\\n     'ls-tree filtered with path0/' \\\n     'git ls-tree $tree path0/ >current &&\n-     make_expected <<\\EOF &&\n+     cat >expected <<\\EOF &&\n EOF\n      test_output'\n \n@@ -124,7 +112,7 @@ EOF\n test_expect_success \\\n     'ls-tree filtered with path2' \\\n     'git ls-tree $tree path2 >current &&\n-     make_expected <<\\EOF &&\n+     cat >expected <<\\EOF &&\n 040000 tree X\tpath2\n EOF\n      test_output'\n@@ -133,7 +121,7 @@ EOF\n test_expect_success \\\n     'ls-tree filtered with path2/' \\\n     'git ls-tree $tree path2/ >current &&\n-     make_expected <<\\EOF &&\n+     cat >expected <<\\EOF &&\n 040000 tree X\tpath2/baz\n 120000 blob X\tpath2/bazbo\n 100644 blob X\tpath2/foo\n@@ -145,7 +133,7 @@ EOF\n test_expect_success \\\n     'ls-tree filtered with path2/baz' \\\n     'git ls-tree $tree path2/baz >current &&\n-     make_expected <<\\EOF &&\n+     cat >expected <<\\EOF &&\n 040000 tree X\tpath2/baz\n EOF\n      test_output'\n@@ -153,14 +141,14 @@ EOF\n test_expect_success \\\n     'ls-tree filtered with path2/bak' \\\n     'git ls-tree $tree path2/bak >current &&\n-     make_expected <<\\EOF &&\n+     cat >expected <<\\EOF &&\n EOF\n      test_output'\n \n test_expect_success \\\n     'ls-tree -t filtered with path2/bak' \\\n     'git ls-tree -t $tree path2/bak >current &&\n-     make_expected <<\\EOF &&\n+     cat >expected <<\\EOF &&\n 040000 tree X\tpath2\n EOF\n      test_output'\n@@ -168,7 +156,7 @@ EOF\n test_expect_success \\\n     'ls-tree with one path a prefix of the other' \\\n     'git ls-tree $tree path2/baz path2/bazbo >current &&\n-     make_expected <<\\EOF &&\n+     cat >expected <<\\EOF &&\n 040000 tree X\tpath2/baz\n 120000 blob X\tpath2/bazbo\n EOF\n-- \n1.8.3.rc1.32.g8b61cbb\n"},{"id":"219124","messageId":"984288047a44d58c55009c32a96d92104d7988c6.1370076477.git.j6t@kdbg.org","threadId":"34006","inReplyTo":"cover.1370076477.git.j6t@kdbg.org","subject":"[PATCH 10/11] t3509, t4023, t4114: use test_ln_s_add to remove SYMLINKS prerequisite","fromName":"Johannes Sixt","fromEmail":"j6t@kdbg.org","sentAt":"2013-06-01T09:34:29Z","receivedAt":"2013-06-01T09:34:29Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"In t4023 and t4114, we have to remove the entries using 'git rm' because\notherwise the entries that must turn from symbolic links to regular files\nwould stay symbolic links in the index. For the same reason, we have to\nuse 'git mv' instead of plain 'mv' in t3509.\n\nSigned-off-by: Johannes Sixt <j6t@kdbg.org>\n---\n t/t3509-cherry-pick-merge-df.sh   | 12 +++++-------\n t/t4023-diff-rename-typechange.sh | 28 ++++++++++++++--------------\n t/t4114-apply-typechange.sh       | 29 ++++++++++++++---------------\n 3 files changed, 33 insertions(+), 36 deletions(-)\n\ndiff --git a/t/t3509-cherry-pick-merge-df.sh b/t/t3509-cherry-pick-merge-df.sh\nindex df921d1..a5b6a5f 100755\n--- a/t/t3509-cherry-pick-merge-df.sh\n+++ b/t/t3509-cherry-pick-merge-df.sh\n@@ -10,17 +10,15 @@ test_expect_success 'Initialize repository' '\n \tgit commit -m a\n '\n \n-test_expect_success SYMLINKS 'Setup rename across paths each below D/F conflicts' '\n+test_expect_success 'Setup rename across paths each below D/F conflicts' '\n \tmkdir b &&\n-\tln -s ../a b/a &&\n-\tgit add b &&\n+\ttest_ln_s_add ../a b/a &&\n \tgit commit -m b &&\n \n \tgit checkout -b branch &&\n \trm b/a &&\n-\tmv a b/a &&\n-\tln -s b/a a &&\n-\tgit add . &&\n+\tgit mv a b/a &&\n+\ttest_ln_s_add b/a a &&\n \tgit commit -m swap &&\n \n \t>f1 &&\n@@ -28,7 +26,7 @@ test_expect_success SYMLINKS 'Setup rename across paths each below D/F conflicts\n \tgit commit -m f1\n '\n \n-test_expect_success SYMLINKS 'Cherry-pick succeeds with rename across D/F conflicts' '\n+test_expect_success 'Cherry-pick succeeds with rename across D/F conflicts' '\n \tgit reset --hard &&\n \tgit checkout master^0 &&\n \tgit cherry-pick branch\ndiff --git a/t/t4023-diff-rename-typechange.sh b/t/t4023-diff-rename-typechange.sh\nindex 5d20acf..55d549f 100755\n--- a/t/t4023-diff-rename-typechange.sh\n+++ b/t/t4023-diff-rename-typechange.sh\n@@ -4,44 +4,44 @@ test_description='typechange rename detection'\n \n . ./test-lib.sh\n \n-test_expect_success SYMLINKS setup '\n+test_expect_success setup '\n \n \trm -f foo bar &&\n \tcat \"$TEST_DIRECTORY\"/../COPYING >foo &&\n-\tln -s linklink bar &&\n-\tgit add foo bar &&\n+\ttest_ln_s_add linklink bar &&\n+\tgit add foo &&\n \tgit commit -a -m Initial &&\n \tgit tag one &&\n \n-\trm -f foo bar &&\n+\tgit rm -f foo bar &&\n \tcat \"$TEST_DIRECTORY\"/../COPYING >bar &&\n-\tln -s linklink foo &&\n-\tgit add foo bar &&\n+\ttest_ln_s_add linklink foo &&\n+\tgit add bar &&\n \tgit commit -a -m Second &&\n \tgit tag two &&\n \n-\trm -f foo bar &&\n+\tgit rm -f foo bar &&\n \tcat \"$TEST_DIRECTORY\"/../COPYING >foo &&\n \tgit add foo &&\n \tgit commit -a -m Third &&\n \tgit tag three &&\n \n \tmv foo bar &&\n-\tln -s linklink foo &&\n-\tgit add foo bar &&\n+\ttest_ln_s_add linklink foo &&\n+\tgit add bar &&\n \tgit commit -a -m Fourth &&\n \tgit tag four &&\n \n \t# This is purely for sanity check\n \n-\trm -f foo bar &&\n+\tgit rm -f foo bar &&\n \tcat \"$TEST_DIRECTORY\"/../COPYING >foo &&\n \tcat \"$TEST_DIRECTORY\"/../Makefile >bar &&\n \tgit add foo bar &&\n \tgit commit -a -m Fifth &&\n \tgit tag five &&\n \n-\trm -f foo bar &&\n+\tgit rm -f foo bar &&\n \tcat \"$TEST_DIRECTORY\"/../Makefile >foo &&\n \tcat \"$TEST_DIRECTORY\"/../COPYING >bar &&\n \tgit add foo bar &&\n@@ -50,7 +50,7 @@ test_expect_success SYMLINKS setup '\n \n '\n \n-test_expect_success SYMLINKS 'cross renames to be detected for regular files' '\n+test_expect_success 'cross renames to be detected for regular files' '\n \n \tgit diff-tree five six -r --name-status -B -M | sort >actual &&\n \t{\n@@ -61,7 +61,7 @@ test_expect_success SYMLINKS 'cross renames to be detected for regular files' '\n \n '\n \n-test_expect_success SYMLINKS 'cross renames to be detected for typechange' '\n+test_expect_success 'cross renames to be detected for typechange' '\n \n \tgit diff-tree one two -r --name-status -B -M | sort >actual &&\n \t{\n@@ -72,7 +72,7 @@ test_expect_success SYMLINKS 'cross renames to be detected for typechange' '\n \n '\n \n-test_expect_success SYMLINKS 'moves and renames' '\n+test_expect_success 'moves and renames' '\n \n \tgit diff-tree three four -r --name-status -B -M | sort >actual &&\n \t{\ndiff --git a/t/t4114-apply-typechange.sh b/t/t4114-apply-typechange.sh\nindex f12826f..ebadbc3 100755\n--- a/t/t4114-apply-typechange.sh\n+++ b/t/t4114-apply-typechange.sh\n@@ -9,20 +9,19 @@ test_description='git apply should not get confused with type changes.\n \n . ./test-lib.sh\n \n-test_expect_success SYMLINKS 'setup repository and commits' '\n+test_expect_success 'setup repository and commits' '\n \techo \"hello world\" > foo &&\n \techo \"hi planet\" > bar &&\n \tgit update-index --add foo bar &&\n \tgit commit -m initial &&\n \tgit branch initial &&\n \trm -f foo &&\n-\tln -s bar foo &&\n-\tgit update-index foo &&\n+\ttest_ln_s_add bar foo &&\n \tgit commit -m \"foo symlinked to bar\" &&\n \tgit branch foo-symlinked-to-bar &&\n-\trm -f foo &&\n+\tgit rm -f foo &&\n \techo \"how far is the sun?\" > foo &&\n-\tgit update-index foo &&\n+\tgit update-index --add foo &&\n \tgit commit -m \"foo back to file\" &&\n \tgit branch foo-back-to-file &&\n \tprintf \"\\0\" > foo &&\n@@ -42,7 +41,7 @@ test_expect_success SYMLINKS 'setup repository and commits' '\n \tgit branch foo-baz-renamed-from-foo\n \t'\n \n-test_expect_success SYMLINKS 'file renamed from foo to foo/baz' '\n+test_expect_success 'file renamed from foo to foo/baz' '\n \tgit checkout -f initial &&\n \tgit diff-tree -M -p HEAD foo-baz-renamed-from-foo > patch &&\n \tgit apply --index < patch\n@@ -50,7 +49,7 @@ test_expect_success SYMLINKS 'file renamed from foo to foo/baz' '\n test_debug 'cat patch'\n \n \n-test_expect_success SYMLINKS 'file renamed from foo/baz to foo' '\n+test_expect_success 'file renamed from foo/baz to foo' '\n \tgit checkout -f foo-baz-renamed-from-foo &&\n \tgit diff-tree -M -p HEAD initial > patch &&\n \tgit apply --index < patch\n@@ -58,7 +57,7 @@ test_expect_success SYMLINKS 'file renamed from foo/baz to foo' '\n test_debug 'cat patch'\n \n \n-test_expect_success SYMLINKS 'directory becomes file' '\n+test_expect_success 'directory becomes file' '\n \tgit checkout -f foo-becomes-a-directory &&\n \tgit diff-tree -p HEAD initial > patch &&\n \tgit apply --index < patch\n@@ -66,7 +65,7 @@ test_expect_success SYMLINKS 'directory becomes file' '\n test_debug 'cat patch'\n \n \n-test_expect_success SYMLINKS 'file becomes directory' '\n+test_expect_success 'file becomes directory' '\n \tgit checkout -f initial &&\n \tgit diff-tree -p HEAD foo-becomes-a-directory > patch &&\n \tgit apply --index < patch\n@@ -74,7 +73,7 @@ test_expect_success SYMLINKS 'file becomes directory' '\n test_debug 'cat patch'\n \n \n-test_expect_success SYMLINKS 'file becomes symlink' '\n+test_expect_success 'file becomes symlink' '\n \tgit checkout -f initial &&\n \tgit diff-tree -p HEAD foo-symlinked-to-bar > patch &&\n \tgit apply --index < patch\n@@ -82,21 +81,21 @@ test_expect_success SYMLINKS 'file becomes symlink' '\n test_debug 'cat patch'\n \n \n-test_expect_success SYMLINKS 'symlink becomes file' '\n+test_expect_success 'symlink becomes file' '\n \tgit checkout -f foo-symlinked-to-bar &&\n \tgit diff-tree -p HEAD foo-back-to-file > patch &&\n \tgit apply --index < patch\n \t'\n test_debug 'cat patch'\n \n-test_expect_success SYMLINKS 'binary file becomes symlink' '\n+test_expect_success 'binary file becomes symlink' '\n \tgit checkout -f foo-becomes-binary &&\n \tgit diff-tree -p --binary HEAD foo-symlinked-to-bar > patch &&\n \tgit apply --index < patch\n \t'\n test_debug 'cat patch'\n \n-test_expect_success SYMLINKS 'symlink becomes binary file' '\n+test_expect_success 'symlink becomes binary file' '\n \tgit checkout -f foo-symlinked-to-bar &&\n \tgit diff-tree -p --binary HEAD foo-becomes-binary > patch &&\n \tgit apply --index < patch\n@@ -104,7 +103,7 @@ test_expect_success SYMLINKS 'symlink becomes binary file' '\n test_debug 'cat patch'\n \n \n-test_expect_success SYMLINKS 'symlink becomes directory' '\n+test_expect_success 'symlink becomes directory' '\n \tgit checkout -f foo-symlinked-to-bar &&\n \tgit diff-tree -p HEAD foo-becomes-a-directory > patch &&\n \tgit apply --index < patch\n@@ -112,7 +111,7 @@ test_expect_success SYMLINKS 'symlink becomes directory' '\n test_debug 'cat patch'\n \n \n-test_expect_success SYMLINKS 'directory becomes symlink' '\n+test_expect_success 'directory becomes symlink' '\n \tgit checkout -f foo-becomes-a-directory &&\n \tgit diff-tree -p HEAD foo-symlinked-to-bar > patch &&\n \tgit apply --index < patch\n-- \n1.8.3.rc1.32.g8b61cbb\n"},{"id":"219121","messageId":"8a25465341d7607f41292f43bf65aac04f7f8920.1370076477.git.j6t@kdbg.org","threadId":"34006","inReplyTo":"cover.1370076477.git.j6t@kdbg.org","subject":"[PATCH 11/11] t6035: use test_ln_s_add to remove SYMLINKS prerequisite","fromName":"Johannes Sixt","fromEmail":"j6t@kdbg.org","sentAt":"2013-06-01T09:34:30Z","receivedAt":"2013-06-01T09:34:30Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"All tests in t6035 are protected by SYMLINKS. But that is not necessary,\nbecause a lot of the functionality can be tested provided symbolic link\nentries enter the index and object data base. Use test_ln_s_add for this\npurpose.\n\nSome test cases do test the presence of symbolic links on the file system.\nMove these tests into separate test cases that remain protected by\nSYMLINKS.\n\nThere is one instance of expect_failure. There is a possibility that this\ntest case fails differently depending on whether SYMLINKS is present or\nnot; but this is not the case.\n\nSigned-off-by: Johannes Sixt <j6t@kdbg.org>\n---\n t/t6035-merge-dir-to-symlink.sh | 73 ++++++++++++++++++++++++++---------------\n 1 file changed, 47 insertions(+), 26 deletions(-)\n\ndiff --git a/t/t6035-merge-dir-to-symlink.sh b/t/t6035-merge-dir-to-symlink.sh\nindex 2599ae5..9324ea4 100755\n--- a/t/t6035-merge-dir-to-symlink.sh\n+++ b/t/t6035-merge-dir-to-symlink.sh\n@@ -3,7 +3,7 @@\n test_description='merging when a directory was replaced with a symlink'\n . ./test-lib.sh\n \n-test_expect_success SYMLINKS 'create a commit where dir a/b changed to symlink' '\n+test_expect_success 'create a commit where dir a/b changed to symlink' '\n \tmkdir -p a/b/c a/b-2/c &&\n \t> a/b/c/d &&\n \t> a/b-2/c/d &&\n@@ -12,12 +12,12 @@ test_expect_success SYMLINKS 'create a commit where dir a/b changed to symlink'\n \tgit commit -m base &&\n \tgit tag start &&\n \trm -rf a/b &&\n-\tln -s b-2 a/b &&\n \tgit add -A &&\n+\ttest_ln_s_add b-2 a/b &&\n \tgit commit -m \"dir to symlink\"\n '\n \n-test_expect_success SYMLINKS 'checkout does not clobber untracked symlink' '\n+test_expect_success 'checkout does not clobber untracked symlink' '\n \tgit checkout HEAD^0 &&\n \tgit reset --hard master &&\n \tgit rm --cached a/b &&\n@@ -25,7 +25,7 @@ test_expect_success SYMLINKS 'checkout does not clobber untracked symlink' '\n \ttest_must_fail git checkout start^0\n '\n \n-test_expect_success SYMLINKS 'a/b-2/c/d is kept when clobbering symlink b' '\n+test_expect_success 'a/b-2/c/d is kept when clobbering symlink b' '\n \tgit checkout HEAD^0 &&\n \tgit reset --hard master &&\n \tgit rm --cached a/b &&\n@@ -34,14 +34,14 @@ test_expect_success SYMLINKS 'a/b-2/c/d is kept when clobbering symlink b' '\n \ttest -f a/b-2/c/d\n '\n \n-test_expect_success SYMLINKS 'checkout should not have deleted a/b-2/c/d' '\n+test_expect_success 'checkout should not have deleted a/b-2/c/d' '\n \tgit checkout HEAD^0 &&\n \tgit reset --hard master &&\n \t git checkout start^0 &&\n \t test -f a/b-2/c/d\n '\n \n-test_expect_success SYMLINKS 'setup for merge test' '\n+test_expect_success 'setup for merge test' '\n \tgit reset --hard &&\n \ttest -f a/b-2/c/d &&\n \techo x > a/x &&\n@@ -50,39 +50,51 @@ test_expect_success SYMLINKS 'setup for merge test' '\n \tgit tag baseline\n '\n \n-test_expect_success SYMLINKS 'Handle D/F conflict, do not lose a/b-2/c/d in merge (resolve)' '\n+test_expect_success 'Handle D/F conflict, do not lose a/b-2/c/d in merge (resolve)' '\n \tgit reset --hard &&\n \tgit checkout baseline^0 &&\n \tgit merge -s resolve master &&\n-\ttest -h a/b &&\n \ttest -f a/b-2/c/d\n '\n \n-test_expect_success SYMLINKS 'Handle D/F conflict, do not lose a/b-2/c/d in merge (recursive)' '\n+test_expect_success SYMLINKS 'a/b was resolved as symlink' '\n+\ttest -h a/b\n+'\n+\n+test_expect_success 'Handle D/F conflict, do not lose a/b-2/c/d in merge (recursive)' '\n \tgit reset --hard &&\n \tgit checkout baseline^0 &&\n \tgit merge -s recursive master &&\n-\ttest -h a/b &&\n \ttest -f a/b-2/c/d\n '\n \n-test_expect_success SYMLINKS 'Handle F/D conflict, do not lose a/b-2/c/d in merge (resolve)' '\n+test_expect_success SYMLINKS 'a/b was resolved as symlink' '\n+\ttest -h a/b\n+'\n+\n+test_expect_success 'Handle F/D conflict, do not lose a/b-2/c/d in merge (resolve)' '\n \tgit reset --hard &&\n \tgit checkout master^0 &&\n \tgit merge -s resolve baseline^0 &&\n-\ttest -h a/b &&\n \ttest -f a/b-2/c/d\n '\n \n-test_expect_success SYMLINKS 'Handle F/D conflict, do not lose a/b-2/c/d in merge (recursive)' '\n+test_expect_success SYMLINKS 'a/b was resolved as symlink' '\n+\ttest -h a/b\n+'\n+\n+test_expect_success 'Handle F/D conflict, do not lose a/b-2/c/d in merge (recursive)' '\n \tgit reset --hard &&\n \tgit checkout master^0 &&\n \tgit merge -s recursive baseline^0 &&\n-\ttest -h a/b &&\n \ttest -f a/b-2/c/d\n '\n \n-test_expect_failure SYMLINKS 'do not lose untracked in merge (resolve)' '\n+test_expect_success SYMLINKS 'a/b was resolved as symlink' '\n+\ttest -h a/b\n+'\n+\n+test_expect_failure 'do not lose untracked in merge (resolve)' '\n \tgit reset --hard &&\n \tgit checkout baseline^0 &&\n \t>a/b/c/e &&\n@@ -91,7 +103,7 @@ test_expect_failure SYMLINKS 'do not lose untracked in merge (resolve)' '\n \ttest -f a/b-2/c/d\n '\n \n-test_expect_success SYMLINKS 'do not lose untracked in merge (recursive)' '\n+test_expect_success 'do not lose untracked in merge (recursive)' '\n \tgit reset --hard &&\n \tgit checkout baseline^0 &&\n \t>a/b/c/e &&\n@@ -100,52 +112,61 @@ test_expect_success SYMLINKS 'do not lose untracked in merge (recursive)' '\n \ttest -f a/b-2/c/d\n '\n \n-test_expect_success SYMLINKS 'do not lose modifications in merge (resolve)' '\n+test_expect_success 'do not lose modifications in merge (resolve)' '\n \tgit reset --hard &&\n \tgit checkout baseline^0 &&\n \techo more content >>a/b/c/d &&\n \ttest_must_fail git merge -s resolve master\n '\n \n-test_expect_success SYMLINKS 'do not lose modifications in merge (recursive)' '\n+test_expect_success 'do not lose modifications in merge (recursive)' '\n \tgit reset --hard &&\n \tgit checkout baseline^0 &&\n \techo more content >>a/b/c/d &&\n \ttest_must_fail git merge -s recursive master\n '\n \n-test_expect_success SYMLINKS 'setup a merge where dir a/b-2 changed to symlink' '\n+test_expect_success 'setup a merge where dir a/b-2 changed to symlink' '\n \tgit reset --hard &&\n \tgit checkout start^0 &&\n \trm -rf a/b-2 &&\n-\tln -s b a/b-2 &&\n \tgit add -A &&\n+\ttest_ln_s_add b a/b-2 &&\n \tgit commit -m \"dir a/b-2 to symlink\" &&\n \tgit tag test2\n '\n \n-test_expect_success SYMLINKS 'merge should not have D/F conflicts (resolve)' '\n+test_expect_success 'merge should not have D/F conflicts (resolve)' '\n \tgit reset --hard &&\n \tgit checkout baseline^0 &&\n \tgit merge -s resolve test2 &&\n-\ttest -h a/b-2 &&\n \ttest -f a/b/c/d\n '\n \n-test_expect_success SYMLINKS 'merge should not have D/F conflicts (recursive)' '\n+test_expect_success SYMLINKS 'a/b-2 was resolved as symlink' '\n+\ttest -h a/b-2\n+'\n+\n+test_expect_success 'merge should not have D/F conflicts (recursive)' '\n \tgit reset --hard &&\n \tgit checkout baseline^0 &&\n \tgit merge -s recursive test2 &&\n-\ttest -h a/b-2 &&\n \ttest -f a/b/c/d\n '\n \n-test_expect_success SYMLINKS 'merge should not have F/D conflicts (recursive)' '\n+test_expect_success SYMLINKS 'a/b-2 was resolved as symlink' '\n+\ttest -h a/b-2\n+'\n+\n+test_expect_success 'merge should not have F/D conflicts (recursive)' '\n \tgit reset --hard &&\n \tgit checkout -b foo test2 &&\n \tgit merge -s recursive baseline^0 &&\n-\ttest -h a/b-2 &&\n \ttest -f a/b/c/d\n '\n \n+test_expect_success SYMLINKS 'a/b-2 was resolved as symlink' '\n+\ttest -h a/b-2\n+'\n+\n test_done\n-- \n1.8.3.rc1.32.g8b61cbb\n"},{"id":"219132","messageId":"CALkWK0nN2V3Cwi3n+DV7Bcme7jE=B+COFioqPFfHQgxGTWEtiA@mail.gmail.com","threadId":"34006","inReplyTo":"c7be5891891d1eeba540a5a24f07d58514345b2b.1370076477.git.j6t@kdbg.org","subject":"Re: [PATCH 04/11] tests: introduce test_ln_s and test_ln_s_add","fromName":"Ramkumar Ramachandra","fromEmail":"artagnon@gmail.com","sentAt":"2013-06-01T11:11:35Z","receivedAt":"2013-06-01T11:11:35Z","isPatch":true,"sender":{"key":"r@artagnon.com","avatar":"https://avatars.githubusercontent.com/u/37226?v=4"},"body":"Johannes Sixt wrote:\n> +test_ln_s_add () {\n> +       if test_have_prereq SYMLINKS\n> +       then\n> +               ln -s \"$1\" \"$2\" &&\n> +               git update-index --add \"$2\"\n> +       else\n> +               printf '%s' \"$1\" >\"$2\" &&\n> +               ln_s_obj=$(git hash-object -w \"$2\") &&\n> +               git update-index --add --cacheinfo 120000 $ln_s_obj \"$2\"\n> +       fi\n> +}\n\nNicely done.  As far as git is concerned, a symlink is nothing but a\nplain file containing the destination filename (minus the newline)\nwith mode 120000 in the index.\n\n> +test_ln_s () {\n> +       if test_have_prereq SYMLINKS\n> +       then\n> +               ln -s \"$1\" \"$2\"\n> +       else\n> +               printf '%s' \"$1\" >\"$2\"\n> +       fi\n> +}\n\nWhat is this?  We can't test_ln_s something and then 'git add' it, so\nwhat purpose does this serve?\n"},{"id":"219147","messageId":"51AA0DD9.9030704@kdbg.org","threadId":"34006","inReplyTo":"CALkWK0nN2V3Cwi3n+DV7Bcme7jE=B+COFioqPFfHQgxGTWEtiA@mail.gmail.com","subject":"Re: [PATCH 04/11] tests: introduce test_ln_s and test_ln_s_add","fromName":"Johannes Sixt","fromEmail":"j6t@kdbg.org","sentAt":"2013-06-01T15:06:01Z","receivedAt":"2013-06-01T15:06:01Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Am 01.06.2013 13:11, schrieb Ramkumar Ramachandra:\n> Johannes Sixt wrote:\n>> +test_ln_s () {\n>> +       if test_have_prereq SYMLINKS\n>> +       then\n>> +               ln -s \"$1\" \"$2\"\n>> +       else\n>> +               printf '%s' \"$1\" >\"$2\"\n>> +       fi\n>> +}\n> \n> What is this?  We can't test_ln_s something and then 'git add' it, so\n> what purpose does this serve?\n\nSure, we can 'git add' it:\n\n# - Use test_ln_s instead of \"ln -s x y\" when y has been added as a\n#   symbolic link entry earlier.\n\n-- Hannes\n"},{"id":"219149","messageId":"CALkWK0k3KG2657BJLOyGSaRF8teaigpRLwiq=-ppQWOCO7w0tA@mail.gmail.com","threadId":"34006","inReplyTo":"51AA0DD9.9030704@kdbg.org","subject":"Re: [PATCH 04/11] tests: introduce test_ln_s and test_ln_s_add","fromName":"Ramkumar Ramachandra","fromEmail":"artagnon@gmail.com","sentAt":"2013-06-01T17:10:12Z","receivedAt":"2013-06-01T17:10:12Z","isPatch":true,"sender":{"key":"r@artagnon.com","avatar":"https://avatars.githubusercontent.com/u/37226?v=4"},"body":"Johannes Sixt wrote:\n> # - Use test_ln_s instead of \"ln -s x y\" when y has been added as a\n> #   symbolic link entry earlier.\n\nAh, sorry I skipped over the comments.\n"},{"id":"219205","messageId":"7vk3mckrgu.fsf@alter.siamese.dyndns.org","threadId":"34006","inReplyTo":"984288047a44d58c55009c32a96d92104d7988c6.1370076477.git.j6t@kdbg.org","subject":"Re: [PATCH 10/11] t3509, t4023, t4114: use test_ln_s_add to remove SYMLINKS prerequisite","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-06-02T23:44:49Z","receivedAt":"2013-06-02T23:44:49Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Sixt <j6t@kdbg.org> writes:\n\n> In t4023 and t4114, we have to remove the entries using 'git rm' because\n> otherwise the entries that must turn from symbolic links to regular files\n> would stay symbolic links in the index. For the same reason, we have to\n> use 'git mv' instead of plain 'mv' in t3509.\n>\n> Signed-off-by: Johannes Sixt <j6t@kdbg.org>\n> ---\n\nI am in general in favor of the direction this one is going.  Thanks\nfor working on this.\n"},{"id":"219406","messageId":"7vwqq960wn.fsf@alter.siamese.dyndns.org","threadId":"34006","inReplyTo":"3c8aaaa4ad606d2afb7c110a28c119792caa8aba.1370076477.git.j6t@kdbg.org","subject":"Re: [PATCH 05/11] tests: use test_ln_s_add to remove SYMLINKS prerequisite (trivial cases)","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-06-04T21:06:48Z","receivedAt":"2013-06-04T21:06:48Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Sixt <j6t@kdbg.org> writes:\n\n> There are many instances where the treatment of symbolic links in the\n> object model and the algorithms are tested, but where it is not\n> necessary to actually have a symbolic link in the worktree. Make\n> adjustments to the tests and remove the SYMLINKS prerequisite when\n> appropriate in trivial cases, where \"trivial\" means:\n>\n> - merely a replacement of 'ln -s a b' to test_ln_s or of\n>   'ln -s a b && git add b' to test_ln_s_add is needed;\n>\n> - a test for symbolic link on the file system can be split off (and\n>   remains protected by SYMLINKS);\n>\n> - existing code is equivalent to test_ln_s[_add].\n\nThis is too big to review in one go, so I may have separate messages\nlater on this same patch.\n\n> diff --git a/t/t2003-checkout-cache-mkdir.sh b/t/t2003-checkout-cache-mkdir.sh\n> index ff163cf..bd17ba2 100755\n> --- a/t/t2003-checkout-cache-mkdir.sh\n> +++ b/t/t2003-checkout-cache-mkdir.sh\n> @@ -19,10 +19,10 @@ test_expect_success 'setup' '\n>  \tgit update-index --add path0 path1/file1\n>  '\n>  \n> -test_expect_success SYMLINKS 'have symlink in place where dir is expected.' '\n> +test_expect_success 'have symlink in place where dir is expected.' '\n>  \trm -fr path0 path1 &&\n>  \tmkdir path2 &&\n> -\tln -s path2 path1 &&\n> +\ttest_ln_s path2 path1 &&\n>  \tgit checkout-index -f -a &&\n>  \ttest ! -h path1 && test -d path1 &&\n>  \ttest -f path1/file1 && test ! -f path2/file1\n\nI do not think this hunk is correct.\n\nWe have two regular files in the index: path0, path1/file1, and we\nadd a symbolic link path1 that happens to point at directory path2/\nin the working tree.\n\nThe test is about making sure that checkout-index is not confused by\nthe symbolic link in the working tree, by attempting to checkout\npath1/file1.\n\nUnder the precondition checkout-index runs in this test, a casual\n\n\techo rezrov >path1/file1\n\nwould leave path1 as a symlink without turning it into a real\ndirectory, and we will end up creating path2/file1.  We are making\nsure that checkout-index does not behave that way, and it is\nessential to have symlink support in the working tree for the \"bug\"\nto trigger.\n\nOn a filesystem without symbolic links, the patched test would pass\njust fine, but there can be no aliasing between path1 and path2 in\nthe first place.\n\n> @@ -79,10 +79,10 @@ test_expect_success SYMLINKS 'use --prefix=tmp/orary- where tmp is a symlink' '\n>  \ttest -h tmp\n>  '\n>  \n> -test_expect_success SYMLINKS 'use --prefix=tmp- where tmp-path1 is a symlink' '\n> +test_expect_success 'use --prefix=tmp- where tmp-path1 is a symlink' '\n>  \trm -fr path0 path1 path2 tmp* &&\n>  \tmkdir tmp1 &&\n> -\tln -s tmp1 tmp-path1 &&\n> +\ttest_ln_s tmp1 tmp-path1 &&\n>  \tgit checkout-index --prefix=tmp- -f -a &&\n>  \ttest -f tmp-path0 &&\n>  \ttest ! -h tmp-path1 &&\n\nThis change has the same issue, I think.  We prepare tmp-path1\nsymbolic link to trap a casual \"echo rezrov >tmp-path1/file1\" to be\nredirected to tmp1/file1 while leaving tmp-path1 as a symlink,\nmaking sure we do the equivalent of \"rm tmp-path1; mkdir tmp-path1\"\nbefore \"echo rezrov >tmp-path1/file1\".\n"},{"id":"219418","messageId":"7vd2s15yoa.fsf@alter.siamese.dyndns.org","threadId":"34006","inReplyTo":"3c8aaaa4ad606d2afb7c110a28c119792caa8aba.1370076477.git.j6t@kdbg.org","subject":"Re: [PATCH 05/11] tests: use test_ln_s_add to remove SYMLINKS prerequisite (trivial cases)","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-06-04T21:55:01Z","receivedAt":"2013-06-04T21:55:01Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Sixt <j6t@kdbg.org> writes:\n\n> There are many instances where the treatment of symbolic links in the\n> object model and the algorithms are tested, but where it is not\n> necessary to actually have a symbolic link in the worktree.\n\n> diff --git a/t/t3000-ls-files-others.sh b/t/t3000-ls-files-others.sh\n> index 88be904..563ac7f 100755\n> --- a/t/t3000-ls-files-others.sh\n> +++ b/t/t3000-ls-files-others.sh\n> @@ -19,12 +19,7 @@ filesystem.\n>  \n>  test_expect_success 'setup ' '\n>  \tdate >path0 &&\n> -\tif test_have_prereq SYMLINKS\n> -\tthen\n> -\t\tln -s xyzzy path1\n> -\telse\n> -\t\tdate >path1\n> -\tfi &&\n> +\ttest_ln_s xyzzy path1 &&\n>  \tmkdir path2 path3 path4 &&\n>  \tdate >path2/file2 &&\n>  \tdate >path2-junk &&\n\nThis also is not appropriate, but it is not as bad as the one in\nt2003 I earlier commented on.\n\nThis test wants an untracked symbolic link in the working tree as\npath1 and wants to see \"ls-files -o\" report it as \"other\".  On a\nfilesystem that lack symbolic link, we obviously cannot have one,\nso as a substitute we just create another regular file to make the\nexpected output and comparison simpler. \n\n> diff --git a/t/t3010-ls-files-killed-modified.sh b/t/t3010-ls-files-killed-modified.sh\n> index 2d0ff2d..310e0a2 100755\n> --- a/t/t3010-ls-files-killed-modified.sh\n> +++ b/t/t3010-ls-files-killed-modified.sh\n> @@ -39,12 +39,7 @@ modified without reporting path9 and path10.\n> ...\n> +\ttest_ln_s_add xyzzy path1 &&\n> ...\n>  \tdate >path2/file2 &&\n>  \tdate >path3/file3 &&\n\nThis one is correct; the test wants to make sure that path1 would be\nchecked out as a non-directory, killing any files in path1/ that is\na directory on the filesystem.\n\n> @@ -52,20 +47,14 @@ test_expect_success 'git update-index --add to add various paths.' '\n>  \tdate >path8 &&\n>  \t: >path9 &&\n>  \tdate >path10 &&\n> -\tgit update-index --add -- path0 path1 path?/file? path7 path8 path9 path10 &&\n> +\tgit update-index --add -- path0 path?/file? path7 path8 path9 path10 &&\n\nAnd exclusion of path1 here is a logical consequence of the previous\nchange, so it is good, too.\n\n>  test_expect_success 'git ls-files -k to show killed files.' '\n>  \tdate >path2 &&\n> -\tif test_have_prereq SYMLINKS\n> -\tthen\n> -\t\tln -s frotz path3 &&\n> -\t\tln -s nitfol path5\n> -\telse\n> -\t\tdate >path3 &&\n> -\t\tdate >path5\n> -\tfi &&\n> +\ttest_ln_s frotz path3 &&\n> +\ttest_ln_s nitfol path5 &&\n\nThis falls into the same category as the one in t3000 above.  The\nonly thing that matters in this test is path3 and path5 are non\ndirectories so that the former is killed when path3/file3 needs to\nbe checked out, while path5 will not appear in \"ls-files -k\" output.\nIdeally we would want to test regular files and symlinks as two\ndifferent kinds of \"non directory\" filesystem entities, but on\nplatforms that lack symbolic links we cannot do so, hence we punt\nand create a regular file.\n\n> diff --git a/t/t4011-diff-symlink.sh b/t/t4011-diff-symlink.sh\n> index f0d5041..3888519 100755\n> --- a/t/t4011-diff-symlink.sh\n> +++ b/t/t4011-diff-symlink.sh\n> @@ -66,12 +69,12 @@ test_expect_success SYMLINKS 'diff removed symlink and file' '\n>  \tcompare_diff_patch expected current\n>  '\n>  \n> -test_expect_success SYMLINKS 'diff identical, but newly created symlink and file' '\n> +test_expect_success 'diff identical, but newly created symlink and file' '\n>  \t>expected &&\n>  \trm -f frotz nitfol &&\n>  \techo xyzzy >nitfol &&\n>  \ttest-chmtime +10 nitfol &&\n> -\tln -s xyzzy frotz &&\n> +\ttest_ln_s xyzzy frotz &&\n>  \tgit diff-index -M -p $tree >current &&\n>  \tcompare_diff_patch expected current &&\n\nAs the point of test is to compare $tree that has symlink with\nanother symlink that is identical but newly created one, I think\nthis _does_ want the filesystem entity to be a symbolic link, but\nthe index has frotz as a symlink and the mode propagates to what we\nread from the filesystem on !has_symlinks systems, so this\nconversion may be a correct one, though it is a bit tricky.\n\n> @@ -80,7 +83,7 @@ test_expect_success SYMLINKS 'diff identical, but newly created symlink and file\n>  \tcompare_diff_patch expected current\n>  '\n>  \n> -test_expect_success SYMLINKS 'diff different symlink and file' '\n> +test_expect_success 'diff different symlink and file' '\n>  \tcat >expected <<-\\EOF &&\n>  \tdiff --git a/frotz b/frotz\n>  \tindex 7c465af..df1db54 120000\n> @@ -100,7 +103,7 @@ test_expect_success SYMLINKS 'diff different symlink and file' '\n>  \t+yxyyz\n>  \tEOF\n>  \trm -f frotz &&\n> -\tln -s yxyyz frotz &&\n> +\ttest_ln_s yxyyz frotz &&\n>  \techo yxyyz >nitfol &&\n>  \tgit diff-index -M -p $tree >current &&\n>  \tcompare_diff_patch expected current\n\nLikewise.\n"},{"id":"219420","messageId":"7v8v2p5y7o.fsf@alter.siamese.dyndns.org","threadId":"34006","inReplyTo":"e232ae3efc6f7b282d4402e6e6976b34d34ab3e7.1370076477.git.j6t@kdbg.org","subject":"Re: [PATCH 07/11] t2100: use test_ln_s_add to remove SYMLINKS prerequisite","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-06-04T22:04:59Z","receivedAt":"2013-06-04T22:04:59Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Sixt <j6t@kdbg.org> writes:\n\n> @@ -62,12 +57,7 @@ test_expect_success 'git update-index to add conflicting file path2 should fail'\n>  \n>  test_expect_success 'git update-index to add conflicting symlink path3 should fail' '\n>  \n> -\tif test_have_prereq SYMLINKS\n> -\tthen\n> -\t\tln -s xyzzy path3\n> -\telse\n> -\t\tdate >path3\n> -\tfi &&\n> +\ttest_ln_s xyzzy path3 &&\n>  \ttest_must_fail git update-index --add -- path3\n>  '\n\nThis is also borderline questionable.  With path2, we are already\ntesting that adding a regular file (one variant of \"non directory\")\nat a path that the index expects to see a directory (the index has\npath2/file2 in it at this point) fails, and the test about path3 is\nto make sure that an attempt to add a symbolic link, the other\nvariant of \"non directory\", is rejected the same way.  So it may\nmake more sense to skip this test when !SYMLINKS.\n\nIf we want to really test the equivalent on a filesystem without\nsymbolic links, it would be a more faithful test to attempt to add\nit using \"--add --cacheinfo\" and see it fail, i.e.\n\n   test_must_fail_to_ln_s_add xyzzy path3\n\nwhich would be a copy of test_ln_s_add but has test_must_fail before\ntwo calls to git_update_index it makes.\n\nI think all the test_ln_s_add conversion in the series make sense,\nbut many uses of test_ln_s are questionable, and I suspect it would\ninvite similar confusion down the road.\n"},{"id":"219469","messageId":"51AF925B.90601@kdbg.org","threadId":"34006","inReplyTo":"7vwqq960wn.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH 05/11] tests: use test_ln_s_add to remove SYMLINKS prerequisite (trivial cases)","fromName":"Johannes Sixt","fromEmail":"j6t@kdbg.org","sentAt":"2013-06-05T19:32:43Z","receivedAt":"2013-06-05T19:32:43Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Am 04.06.2013 23:06, schrieb Junio C Hamano:\n> Johannes Sixt <j6t@kdbg.org> writes:\n> \n>> There are many instances where the treatment of symbolic links in the\n>> object model and the algorithms are tested, but where it is not\n>> necessary to actually have a symbolic link in the worktree. Make\n>> adjustments to the tests and remove the SYMLINKS prerequisite when\n>> appropriate in trivial cases, where \"trivial\" means:\n>>\n>> - merely a replacement of 'ln -s a b' to test_ln_s or of\n>>   'ln -s a b && git add b' to test_ln_s_add is needed;\n>>\n>> - a test for symbolic link on the file system can be split off (and\n>>   remains protected by SYMLINKS);\n>>\n>> - existing code is equivalent to test_ln_s[_add].\n> \n> This is too big to review in one go, so I may have separate messages\n> later on this same patch.\n> \n>> diff --git a/t/t2003-checkout-cache-mkdir.sh b/t/t2003-checkout-cache-mkdir.sh\n>> index ff163cf..bd17ba2 100755\n>> --- a/t/t2003-checkout-cache-mkdir.sh\n>> +++ b/t/t2003-checkout-cache-mkdir.sh\n>> @@ -19,10 +19,10 @@ test_expect_success 'setup' '\n>>  \tgit update-index --add path0 path1/file1\n>>  '\n>>  \n>> -test_expect_success SYMLINKS 'have symlink in place where dir is expected.' '\n>> +test_expect_success 'have symlink in place where dir is expected.' '\n>>  \trm -fr path0 path1 &&\n>>  \tmkdir path2 &&\n>> -\tln -s path2 path1 &&\n>> +\ttest_ln_s path2 path1 &&\n>>  \tgit checkout-index -f -a &&\n>>  \ttest ! -h path1 && test -d path1 &&\n>>  \ttest -f path1/file1 && test ! -f path2/file1\n> \n> I do not think this hunk is correct.\n[...]\n> Under the precondition checkout-index runs in this test, a casual\n> \n> \techo rezrov >path1/file1\n> \n> would leave path1 as a symlink without turning it into a real\n> directory, and we will end up creating path2/file1.  We are making\n> sure that checkout-index does not behave that way, and it is\n> essential to have symlink support in the working tree for the \"bug\"\n> to trigger.\n> \n>> @@ -79,10 +79,10 @@ test_expect_success SYMLINKS 'use --prefix=tmp/orary- where tmp is a symlink' '\n>>  \ttest -h tmp\n>>  '\n>>  \n>> -test_expect_success SYMLINKS 'use --prefix=tmp- where tmp-path1 is a symlink' '\n>> +test_expect_success 'use --prefix=tmp- where tmp-path1 is a symlink' '\n>>  \trm -fr path0 path1 path2 tmp* &&\n>>  \tmkdir tmp1 &&\n>> -\tln -s tmp1 tmp-path1 &&\n>> +\ttest_ln_s tmp1 tmp-path1 &&\n>>  \tgit checkout-index --prefix=tmp- -f -a &&\n>>  \ttest -f tmp-path0 &&\n>>  \ttest ! -h tmp-path1 &&\n> \n> This change has the same issue, I think.\n\nYes, agreed. The converted tests -- when SYMLINKS are not available --\njust repeat what is tested elsewhere.\n\nNice catch. After I've found a hammer (test_ln_s) I was mindlessly\nlooking for nails and found two of them in these two instances. ;-)\n\n-- Hannes\n"},{"id":"219470","messageId":"51AF9A77.8050400@kdbg.org","threadId":"34006","inReplyTo":"7vd2s15yoa.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH 05/11] tests: use test_ln_s_add to remove SYMLINKS prerequisite (trivial cases)","fromName":"Johannes Sixt","fromEmail":"j6t@kdbg.org","sentAt":"2013-06-05T20:07:19Z","receivedAt":"2013-06-05T20:07:19Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Am 04.06.2013 23:55, schrieb Junio C Hamano:\n> Johannes Sixt <j6t@kdbg.org> writes:\n>> diff --git a/t/t3000-ls-files-others.sh b/t/t3000-ls-files-others.sh\n>> index 88be904..563ac7f 100755\n>> --- a/t/t3000-ls-files-others.sh\n>> +++ b/t/t3000-ls-files-others.sh\n>> @@ -19,12 +19,7 @@ filesystem.\n>>  \n>>  test_expect_success 'setup ' '\n>>  \tdate >path0 &&\n>> -\tif test_have_prereq SYMLINKS\n>> -\tthen\n>> -\t\tln -s xyzzy path1\n>> -\telse\n>> -\t\tdate >path1\n>> -\tfi &&\n>> +\ttest_ln_s xyzzy path1 &&\n>>  \tmkdir path2 path3 path4 &&\n>>  \tdate >path2/file2 &&\n>>  \tdate >path2-junk &&\n> \n> This also is not appropriate, but it is not as bad as the one in\n> t2003 I earlier commented on.\n> \n> This test wants an untracked symbolic link in the working tree as\n> path1 and wants to see \"ls-files -o\" report it as \"other\".  On a\n> filesystem that lack symbolic link, we obviously cannot have one,\n> so as a substitute we just create another regular file to make the\n> expected output and comparison simpler. \n\nExactly. This is just a convenience. The issue is not introduced by the\nconversion, but dates back 4 years when I added the SYMLINKS check. We\nnow only use a less random string on !SYMLINKS filesystems.\n\n>>  test_expect_success 'git ls-files -k to show killed files.' '\n>>  \tdate >path2 &&\n>> -\tif test_have_prereq SYMLINKS\n>> -\tthen\n>> -\t\tln -s frotz path3 &&\n>> -\t\tln -s nitfol path5\n>> -\telse\n>> -\t\tdate >path3 &&\n>> -\t\tdate >path5\n>> -\tfi &&\n>> +\ttest_ln_s frotz path3 &&\n>> +\ttest_ln_s nitfol path5 &&\n> \n> This falls into the same category as the one in t3000 above.  The\n> only thing that matters in this test is path3 and path5 are non\n> directories so that the former is killed when path3/file3 needs to\n> be checked out, while path5 will not appear in \"ls-files -k\" output.\n> Ideally we would want to test regular files and symlinks as two\n> different kinds of \"non directory\" filesystem entities, but on\n> platforms that lack symbolic links we cannot do so, hence we punt\n> and create a regular file.\n\nIndeed. Same answer.\n\n>> diff --git a/t/t4011-diff-symlink.sh b/t/t4011-diff-symlink.sh\n\n>> -test_expect_success SYMLINKS 'diff identical, but newly created symlink and file' '\n>> +test_expect_success 'diff identical, but newly created symlink and file' '\n>>  \t>expected &&\n>>  \trm -f frotz nitfol &&\n>>  \techo xyzzy >nitfol &&\n>>  \ttest-chmtime +10 nitfol &&\n>> -\tln -s xyzzy frotz &&\n>> +\ttest_ln_s xyzzy frotz &&\n>>  \tgit diff-index -M -p $tree >current &&\n>>  \tcompare_diff_patch expected current &&\n> \n> As the point of test is to compare $tree that has symlink with\n> another symlink that is identical but newly created one, I think\n> this _does_ want the filesystem entity to be a symbolic link, but\n> the index has frotz as a symlink and the mode propagates to what we\n> read from the filesystem on !has_symlinks systems, so this\n> conversion may be a correct one, though it is a bit tricky.\n\nYes, this test depends on the mode propagation. I'll add a comment along\nthese lines and keep the change in this patch with a title marked\n\"trivial cases\".\n\n>> @@ -100,7 +103,7 @@ test_expect_success SYMLINKS 'diff different symlink and file' '\n>>  \t+yxyyz\n>>  \tEOF\n>>  \trm -f frotz &&\n>> -\tln -s yxyyz frotz &&\n>> +\ttest_ln_s yxyyz frotz &&\n>>  \techo yxyyz >nitfol &&\n>>  \tgit diff-index -M -p $tree >current &&\n>>  \tcompare_diff_patch expected current\n> \n> Likewise.\n\n-- Hannes\n"},{"id":"219472","messageId":"51AF9E26.4050809@kdbg.org","threadId":"34006","inReplyTo":"7v8v2p5y7o.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH 07/11] t2100: use test_ln_s_add to remove SYMLINKS prerequisite","fromName":"Johannes Sixt","fromEmail":"j6t@kdbg.org","sentAt":"2013-06-05T20:23:02Z","receivedAt":"2013-06-05T20:23:02Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Am 05.06.2013 00:04, schrieb Junio C Hamano:\n> Johannes Sixt <j6t@kdbg.org> writes:\n> \n>> @@ -62,12 +57,7 @@ test_expect_success 'git update-index to add conflicting file path2 should fail'\n>>  \n>>  test_expect_success 'git update-index to add conflicting symlink path3 should fail' '\n>>  \n>> -\tif test_have_prereq SYMLINKS\n>> -\tthen\n>> -\t\tln -s xyzzy path3\n>> -\telse\n>> -\t\tdate >path3\n>> -\tfi &&\n>> +\ttest_ln_s xyzzy path3 &&\n>>  \ttest_must_fail git update-index --add -- path3\n>>  '\n> \n> This is also borderline questionable.  With path2, we are already\n> testing that adding a regular file (one variant of \"non directory\")\n> at a path that the index expects to see a directory (the index has\n> path2/file2 in it at this point) fails,...\n\nYou are right, of course. But again, the issue is not new with this patch.\n\n> If we want to really test the equivalent on a filesystem without\n> symbolic links, it would be a more faithful test to attempt to add\n> it using \"--add --cacheinfo\" and see it fail, i.e.\n> \n>    test_must_fail_to_ln_s_add xyzzy path3\n> \n> which would be a copy of test_ln_s_add but has test_must_fail before\n> two calls to git_update_index it makes.\n\nThat's not necessary, IMO. We can just add an unconditional --cache-info\ntest here and add SYMLINKS to the above test.\n\n> I think all the test_ln_s_add conversion in the series make sense,\n> but many uses of test_ln_s are questionable, and I suspect it would\n> invite similar confusion down the road.\n\nIncidentally, I've been running the test_ln_s_add conversions since,\nwhoa!, two years now, but added test_ln_s only when I cleaned up the\npatch for submission. Perhaps it's better when I rip out test_ln_s again.\n\n-- Hannes\n"},{"id":"219715","messageId":"cover.1370636706.git.j6t@kdbg.org","threadId":"34006","inReplyTo":"cover.1370076477.git.j6t@kdbg.org","subject":"[PATCH v2 00/10] Increase test coverage on Windows by removing SYMLINKS from many tests","fromName":"Johannes Sixt","fromEmail":"j6t@kdbg.org","sentAt":"2013-06-07T20:53:24Z","receivedAt":"2013-06-07T20:53:24Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Many tests that involve symbolic links actually check only whether our\nalgorithms are correct by investigating the contents of the object\ndatabase and the index. Only some of them check the filesystem.\n\nThis series introduces a function test_ln_s_add that inserts a symbolic\nlink in the index even if the filesystem does not support symbolic links.\nBy using this function, many more tests can be run when the filesystem\ndoes not have symblic links, aka Windows.\n\nChanges since v1:\n\n- Ripped out test_ln_s and corresponding conversions; they were dubious.\n\n- There are no changes to t2100 anymore; the corresponding modernization\n  patch is gone.\n\n- Moved the t4011 change from the \"trivial cases\" to its own patch.\n  It still contains the effects of the former test_ln_s, but open-coded\n  and with a comment.\n\nJohannes Sixt (10):\n  test-chmtime: Fix exit code on Windows\n  t3010: modernize style\n  tests: introduce test_ln_s_add\n  tests: use test_ln_s_add to remove SYMLINKS prerequisite (trivial\n    cases)\n  t0000: use test_ln_s_add to remove SYMLINKS prerequisite\n  t3030: use test_ln_s_add to remove SYMLINKS prerequisite\n  t3100: use test_ln_s_add to remove SYMLINKS prerequisite\n  t3509, t4023, t4114: use test_ln_s_add to remove SYMLINKS prerequisite\n  t6035: use test_ln_s_add to remove SYMLINKS prerequisite\n  t4011: remove SYMLINKS prerequisite\n\n t/README                               |  14 ++++\n t/t0000-basic.sh                       |  39 +++--------\n t/t1004-read-tree-m-u-wf.sh            |   7 +-\n t/t2001-checkout-cache-clash.sh        |   7 +-\n t/t2004-checkout-cache-temp.sh         |   5 +-\n t/t2007-checkout-symlink.sh            |  12 ++--\n t/t2021-checkout-overwrite.sh          |  12 ++--\n t/t2200-add-update.sh                  |   5 +-\n t/t3010-ls-files-killed-modified.sh    | 118 ++++++++++++++++-----------------\n t/t3030-merge-recursive.sh             |  62 ++++++++---------\n t/t3100-ls-tree-restrict.sh            |  42 +++++-------\n t/t3509-cherry-pick-merge-df.sh        |  12 ++--\n t/t3700-add.sh                         |  15 ++---\n t/t3903-stash.sh                       |  39 ++++++++---\n t/t4008-diff-break-rewrite.sh          |  12 ++--\n t/t4011-diff-symlink.sh                |  35 +++++++---\n t/t4023-diff-rename-typechange.sh      |  28 ++++----\n t/t4030-diff-textconv.sh               |   8 +--\n t/t4114-apply-typechange.sh            |  29 ++++----\n t/t4115-apply-symlink.sh               |  10 ++-\n t/t4122-apply-symlink-inside.sh        |   8 +--\n t/t6035-merge-dir-to-symlink.sh        |  73 ++++++++++++--------\n t/t7001-mv.sh                          |  18 +++--\n t/t7607-merge-overwrite.sh             |   5 +-\n t/t8006-blame-textconv.sh              |  14 ++--\n t/t8007-cat-file-textconv.sh           |  10 ++-\n t/t9350-fast-export.sh                 |   5 +-\n t/t9500-gitweb-standalone-no-errors.sh |  15 ++---\n t/test-lib-functions.sh                |  17 +++++\n test-chmtime.c                         |   8 +--\n 30 files changed, 351 insertions(+), 333 deletions(-)\n\n-- \n1.8.3.rc1.32.g8b61cbb\n"},{"id":"219714","messageId":"ba3c59d26cfb23a8c71c66ef1d49c4dca55fc556.1370636706.git.j6t@kdbg.org","threadId":"34006","inReplyTo":"cover.1370076477.git.j6t@kdbg.org","subject":"[PATCH v2 01/10] test-chmtime: Fix exit code on Windows","fromName":"Johannes Sixt","fromEmail":"j6t@kdbg.org","sentAt":"2013-06-07T20:53:25Z","receivedAt":"2013-06-07T20:53:25Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"MinGW's bash does not recognize an exit code -1 as failure. See also\n47e3de0e (MinGW: truncate exit()'s argument to lowest 8 bits) and 2488df84\n(builtin run_command: do not exit with -1). Exit code 1 is good enough.\n\nSigned-off-by: Johannes Sixt <j6t@kdbg.org>\n---\n test-chmtime.c | 8 ++++----\n 1 file changed, 4 insertions(+), 4 deletions(-)\n\ndiff --git a/test-chmtime.c b/test-chmtime.c\nindex 02b42ba..2e601a8 100644\n--- a/test-chmtime.c\n+++ b/test-chmtime.c\n@@ -84,7 +84,7 @@ int main(int argc, const char *argv[])\n \t\tif (stat(argv[i], &sb) < 0) {\n \t\t\tfprintf(stderr, \"Failed to stat %s: %s\\n\",\n \t\t\t        argv[i], strerror(errno));\n-\t\t\treturn -1;\n+\t\t\treturn 1;\n \t\t}\n \n #ifdef WIN32\n@@ -92,7 +92,7 @@ int main(int argc, const char *argv[])\n \t\t\t\tchmod(argv[i], sb.st_mode | S_IWUSR)) {\n \t\t\tfprintf(stderr, \"Could not make user-writable %s: %s\",\n \t\t\t\targv[i], strerror(errno));\n-\t\t\treturn -1;\n+\t\t\treturn 1;\n \t\t}\n #endif\n \n@@ -107,7 +107,7 @@ int main(int argc, const char *argv[])\n \t\tif (utb.modtime != sb.st_mtime && utime(argv[i], &utb) < 0) {\n \t\t\tfprintf(stderr, \"Failed to modify time on %s: %s\\n\",\n \t\t\t        argv[i], strerror(errno));\n-\t\t\treturn -1;\n+\t\t\treturn 1;\n \t\t}\n \t}\n \n@@ -115,5 +115,5 @@ int main(int argc, const char *argv[])\n \n usage:\n \tfprintf(stderr, \"usage: %s %s\\n\", argv[0], usage_str);\n-\treturn -1;\n+\treturn 1;\n }\n-- \n1.8.3.rc1.32.g8b61cbb\n"},{"id":"219706","messageId":"8d271c08f2d49aca17e7bec6d841ac72af7b15b1.1370636706.git.j6t@kdbg.org","threadId":"34006","inReplyTo":"cover.1370076477.git.j6t@kdbg.org","subject":"[PATCH v2 02/10] t3010: modernize style","fromName":"Johannes Sixt","fromEmail":"j6t@kdbg.org","sentAt":"2013-06-07T20:53:26Z","receivedAt":"2013-06-07T20:53:26Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"In particular:\n\n- move test preparations inside test_expect_success\n\n- place test description on the test_expect_success line\n\n- indent with a tab\n\nSigned-off-by: Johannes Sixt <j6t@kdbg.org>\n---\n t/t3010-ls-files-killed-modified.sh | 123 ++++++++++++++++++------------------\n 1 file changed, 61 insertions(+), 62 deletions(-)\n\ndiff --git a/t/t3010-ls-files-killed-modified.sh b/t/t3010-ls-files-killed-modified.sh\nindex 95671c2..2d0ff2d 100755\n--- a/t/t3010-ls-files-killed-modified.sh\n+++ b/t/t3010-ls-files-killed-modified.sh\n@@ -37,71 +37,70 @@ modified without reporting path9 and path10.\n '\n . ./test-lib.sh\n \n-date >path0\n-if test_have_prereq SYMLINKS\n-then\n-\tln -s xyzzy path1\n-else\n-\tdate > path1\n-fi\n-mkdir path2 path3\n-date >path2/file2\n-date >path3/file3\n-: >path7\n-date >path8\n-: >path9\n-date >path10\n-test_expect_success \\\n-    'git update-index --add to add various paths.' \\\n-    \"git update-index --add -- path0 path1 path?/file? path7 path8 path9 path10\"\n-\n-rm -fr path? ;# leave path10 alone\n-date >path2\n-if test_have_prereq SYMLINKS\n-then\n-\tln -s frotz path3\n-\tln -s nitfol path5\n-else\n-\tdate > path3\n-\tdate > path5\n-fi\n-mkdir path0 path1 path6\n-date >path0/file0\n-date >path1/file1\n-date >path6/file6\n-date >path7\n-: >path8\n-: >path9\n-touch path10\n+test_expect_success 'git update-index --add to add various paths.' '\n+\tdate >path0 &&\n+\tif test_have_prereq SYMLINKS\n+\tthen\n+\t\tln -s xyzzy path1\n+\telse\n+\t\tdate > path1\n+\tfi &&\n+\tmkdir path2 path3 &&\n+\tdate >path2/file2 &&\n+\tdate >path3/file3 &&\n+\t: >path7 &&\n+\tdate >path8 &&\n+\t: >path9 &&\n+\tdate >path10 &&\n+\tgit update-index --add -- path0 path1 path?/file? path7 path8 path9 path10 &&\n+\trm -fr path?\t# leave path10 alone\n+'\n \n-test_expect_success \\\n-    'git ls-files -k to show killed files.' \\\n-    'git ls-files -k >.output'\n-cat >.expected <<EOF\n-path0/file0\n-path1/file1\n-path2\n-path3\n-EOF\n+test_expect_success 'git ls-files -k to show killed files.' '\n+\tdate >path2 &&\n+\tif test_have_prereq SYMLINKS\n+\tthen\n+\t\tln -s frotz path3 &&\n+\t\tln -s nitfol path5\n+\telse\n+\t\tdate >path3 &&\n+\t\tdate >path5\n+\tfi &&\n+\tmkdir path0 path1 path6 &&\n+\tdate >path0/file0 &&\n+\tdate >path1/file1 &&\n+\tdate >path6/file6 &&\n+\tdate >path7 &&\n+\t: >path8 &&\n+\t: >path9 &&\n+\ttouch path10 &&\n+\tgit ls-files -k >.output\n+'\n \n-test_expect_success \\\n-    'validate git ls-files -k output.' \\\n-    'test_cmp .expected .output'\n+test_expect_success 'validate git ls-files -k output.' '\n+\tcat >.expected <<-\\EOF &&\n+\tpath0/file0\n+\tpath1/file1\n+\tpath2\n+\tpath3\n+\tEOF\n+\ttest_cmp .expected .output\n+'\n \n-test_expect_success \\\n-    'git ls-files -m to show modified files.' \\\n-    'git ls-files -m >.output'\n-cat >.expected <<EOF\n-path0\n-path1\n-path2/file2\n-path3/file3\n-path7\n-path8\n-EOF\n+test_expect_success 'git ls-files -m to show modified files.' '\n+\tgit ls-files -m >.output\n+'\n \n-test_expect_success \\\n-    'validate git ls-files -m output.' \\\n-    'test_cmp .expected .output'\n+test_expect_success 'validate git ls-files -m output.' '\n+\tcat >.expected <<-\\EOF &&\n+\tpath0\n+\tpath1\n+\tpath2/file2\n+\tpath3/file3\n+\tpath7\n+\tpath8\n+\tEOF\n+\ttest_cmp .expected .output\n+'\n \n test_done\n-- \n1.8.3.rc1.32.g8b61cbb\n"},{"id":"219713","messageId":"6bbcf9909d76a466695a66e894bae8b98612ba15.1370636706.git.j6t@kdbg.org","threadId":"34006","inReplyTo":"cover.1370076477.git.j6t@kdbg.org","subject":"[PATCH v2 03/10] tests: introduce test_ln_s_add","fromName":"Johannes Sixt","fromEmail":"j6t@kdbg.org","sentAt":"2013-06-07T20:53:27Z","receivedAt":"2013-06-07T20:53:27Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Add a new function that creates a symbolic link and adds it to the index\nto be used in cases where a symbolic link is not required on the file\nsystem. We will use it to remove many SYMLINKS prerequisites from test\ncases.\n\nSigned-off-by: Johannes Sixt <j6t@kdbg.org>\n---\n t/README                | 14 ++++++++++++++\n t/test-lib-functions.sh | 17 +++++++++++++++++\n 2 files changed, 31 insertions(+)\n\ndiff --git a/t/README b/t/README\nindex e669bb3..bbe25c3 100644\n--- a/t/README\n+++ b/t/README\n@@ -592,6 +592,20 @@ library for your script to use.\n \t\ttest_cmp expected actual\n \t'\n \n+ - test_ln_s_add <path1> <path2>\n+\n+   This function helps systems whose filesystem does not support symbolic\n+   links. Use it to add a symbolic link entry to the index when it is not\n+   important that the file system entry is a symbolic link, i.e., instead\n+   of the sequence\n+\n+\tln -s foo bar &&\n+\tgit add bar\n+\n+   Sometimes it is possible to split a test in a part that does not need\n+   the symbolic link in the file system and a part that does; then only\n+   the latter part need be protected by a SYMLINKS prerequisite (see below).\n+\n Prerequisites\n -------------\n \ndiff --git a/t/test-lib-functions.sh b/t/test-lib-functions.sh\nindex 5251009..fac9234 100644\n--- a/t/test-lib-functions.sh\n+++ b/t/test-lib-functions.sh\n@@ -679,3 +679,20 @@ test_create_repo () {\n \t\tmv .git/hooks .git/hooks-disabled\n \t) || exit\n }\n+\n+# This function helps on symlink challenged file systems when it is not\n+# important that the file system entry is a symbolic link.\n+# Use test_ln_s_add instead of \"ln -s x y && git add y\" to add a\n+# symbolic link entry y to the index.\n+\n+test_ln_s_add () {\n+\tif test_have_prereq SYMLINKS\n+\tthen\n+\t\tln -s \"$1\" \"$2\" &&\n+\t\tgit update-index --add \"$2\"\n+\telse\n+\t\tprintf '%s' \"$1\" >\"$2\" &&\n+\t\tln_s_obj=$(git hash-object -w \"$2\") &&\n+\t\tgit update-index --add --cacheinfo 120000 $ln_s_obj \"$2\"\n+\tfi\n+}\n-- \n1.8.3.rc1.32.g8b61cbb\n"},{"id":"219716","messageId":"0ad96479c67707b015015d04eec9da94b60987f1.1370636706.git.j6t@kdbg.org","threadId":"34006","inReplyTo":"cover.1370076477.git.j6t@kdbg.org","subject":"[PATCH v2 04/10] tests: use test_ln_s_add to remove SYMLINKS prerequisite (trivial cases)","fromName":"Johannes Sixt","fromEmail":"j6t@kdbg.org","sentAt":"2013-06-07T20:53:28Z","receivedAt":"2013-06-07T20:53:28Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"There are many instances where the treatment of symbolic links in the\nobject model and the algorithms are tested, but where it is not\nnecessary to actually have a symbolic link in the worktree. Make\nadjustments to the tests and remove the SYMLINKS prerequisite when\nappropriate in trivial cases, where \"trivial\" means:\n\n- merely a replacement of 'ln -s a b && git add b' by test_ln_s_add\n  is needed;\n\n- a test for symbolic link on the file system can be split off (and\n  remains protected by SYMLINKS);\n\n- existing code is equivalent to test_ln_s_add.\n\nSigned-off-by: Johannes Sixt <j6t@kdbg.org>\n---\n t/t1004-read-tree-m-u-wf.sh            |  7 +++---\n t/t2001-checkout-cache-clash.sh        |  7 +++---\n t/t2004-checkout-cache-temp.sh         |  5 ++---\n t/t2007-checkout-symlink.sh            | 12 +++++------\n t/t2021-checkout-overwrite.sh          | 12 +++++++----\n t/t2200-add-update.sh                  |  5 ++---\n t/t3010-ls-files-killed-modified.sh    |  9 ++------\n t/t3700-add.sh                         | 15 ++++++-------\n t/t3903-stash.sh                       | 39 ++++++++++++++++++++++++----------\n t/t4008-diff-break-rewrite.sh          | 12 +++++------\n t/t4030-diff-textconv.sh               |  8 +++----\n t/t4115-apply-symlink.sh               | 10 ++++-----\n t/t4122-apply-symlink-inside.sh        |  8 +++----\n t/t7001-mv.sh                          | 18 ++++++++++------\n t/t7607-merge-overwrite.sh             |  5 ++---\n t/t8006-blame-textconv.sh              | 14 +++++-------\n t/t8007-cat-file-textconv.sh           | 10 ++++-----\n t/t9350-fast-export.sh                 |  5 ++---\n t/t9500-gitweb-standalone-no-errors.sh | 15 +++++--------\n 19 files changed, 106 insertions(+), 110 deletions(-)\n\ndiff --git a/t/t1004-read-tree-m-u-wf.sh b/t/t1004-read-tree-m-u-wf.sh\nindex b3ae7d5..3e72aff 100755\n--- a/t/t1004-read-tree-m-u-wf.sh\n+++ b/t/t1004-read-tree-m-u-wf.sh\n@@ -158,7 +158,7 @@ test_expect_success '3-way not overwriting local changes (their side)' '\n \n '\n \n-test_expect_success SYMLINKS 'funny symlink in work tree' '\n+test_expect_success 'funny symlink in work tree' '\n \n \tgit reset --hard &&\n \tgit checkout -b sym-b side-b &&\n@@ -170,15 +170,14 @@ test_expect_success SYMLINKS 'funny symlink in work tree' '\n \trm -fr a &&\n \tgit checkout -b sym-a side-a &&\n \tmkdir -p a &&\n-\tln -s ../b a/b &&\n-\tgit add a/b &&\n+\ttest_ln_s_add ../b a/b &&\n \tgit commit -m \"we add a/b\" &&\n \n \tread_tree_u_must_succeed -m -u sym-a sym-a sym-b\n \n '\n \n-test_expect_success SYMLINKS,SANITY 'funny symlink in work tree, un-unlink-able' '\n+test_expect_success SANITY 'funny symlink in work tree, un-unlink-able' '\n \n \trm -fr a b &&\n \tgit reset --hard &&\ndiff --git a/t/t2001-checkout-cache-clash.sh b/t/t2001-checkout-cache-clash.sh\nindex 98aa73e..1fc8e63 100755\n--- a/t/t2001-checkout-cache-clash.sh\n+++ b/t/t2001-checkout-cache-clash.sh\n@@ -59,10 +59,9 @@ test_expect_success \\\n     'git read-tree -m $tree1 && git checkout-index -f -a'\n test_debug 'show_files $tree1'\n \n-test_expect_success SYMLINKS \\\n-    'git update-index --add a symlink.' \\\n-    'ln -s path0 path1 &&\n-     git update-index --add path1'\n+test_expect_success \\\n+    'add a symlink' \\\n+    'test_ln_s_add path0 path1'\n test_expect_success \\\n     'writing tree out with git write-tree' \\\n     'tree3=$(git write-tree)'\ndiff --git a/t/t2004-checkout-cache-temp.sh b/t/t2004-checkout-cache-temp.sh\nindex 0f4b289..f171a55 100755\n--- a/t/t2004-checkout-cache-temp.sh\n+++ b/t/t2004-checkout-cache-temp.sh\n@@ -194,11 +194,10 @@ test_expect_success \\\n  test $(cat ../$s1) = tree1asubdir/path5)\n )'\n \n-test_expect_success SYMLINKS \\\n+test_expect_success \\\n 'checkout --temp symlink' '\n rm -f path* .merge_* out .git/index &&\n-ln -s b a &&\n-git update-index --add a &&\n+test_ln_s_add b a &&\n t4=$(git write-tree) &&\n rm -f .git/index &&\n git read-tree $t4 &&\ndiff --git a/t/t2007-checkout-symlink.sh b/t/t2007-checkout-symlink.sh\nindex e6f59f1..fc9aad5 100755\n--- a/t/t2007-checkout-symlink.sh\n+++ b/t/t2007-checkout-symlink.sh\n@@ -6,7 +6,7 @@ test_description='git checkout to switch between branches with symlink<->dir'\n \n . ./test-lib.sh\n \n-test_expect_success SYMLINKS setup '\n+test_expect_success setup '\n \n \tmkdir frotz &&\n \techo hello >frotz/filfre &&\n@@ -25,25 +25,25 @@ test_expect_success SYMLINKS setup '\n \n \tgit rm --cached frotz/filfre &&\n \tmv frotz xyzzy &&\n-\tln -s xyzzy frotz &&\n-\tgit add xyzzy/filfre frotz &&\n+\ttest_ln_s_add xyzzy frotz &&\n+\tgit add xyzzy/filfre &&\n \ttest_tick &&\n \tgit commit -m \"side moves frotz/ to xyzzy/ and adds frotz->xyzzy/\"\n \n '\n \n-test_expect_success SYMLINKS 'switch from symlink to dir' '\n+test_expect_success 'switch from symlink to dir' '\n \n \tgit checkout master\n \n '\n \n-test_expect_success SYMLINKS 'Remove temporary directories & switch to master' '\n+test_expect_success 'Remove temporary directories & switch to master' '\n \trm -fr frotz xyzzy nitfol &&\n \tgit checkout -f master\n '\n \n-test_expect_success SYMLINKS 'switch from dir to symlink' '\n+test_expect_success 'switch from dir to symlink' '\n \n \tgit checkout side\n \ndiff --git a/t/t2021-checkout-overwrite.sh b/t/t2021-checkout-overwrite.sh\nindex 5da63e9..c2ada7d 100755\n--- a/t/t2021-checkout-overwrite.sh\n+++ b/t/t2021-checkout-overwrite.sh\n@@ -29,21 +29,25 @@ test_expect_success 'checkout commit with dir must not remove untracked a/b' '\n \ttest -f a/b\n '\n \n-test_expect_success SYMLINKS 'create a commit where dir a/b changed to symlink' '\n+test_expect_success 'create a commit where dir a/b changed to symlink' '\n \n \trm -rf a/b &&\t# cleanup if previous test failed\n \tgit checkout -f -b symlink start &&\n \trm -rf a/b &&\n-\tln -s foo a/b &&\n \tgit add -A &&\n+\ttest_ln_s_add foo a/b &&\n \tgit commit -m \"dir to symlink\"\n '\n \n-test_expect_success SYMLINKS 'checkout commit with dir must not remove untracked a/b' '\n+test_expect_success 'checkout commit with dir must not remove untracked a/b' '\n \n \tgit rm --cached a/b &&\n \tgit commit -m \"un-track the symlink\" &&\n-\ttest_must_fail git checkout start &&\n+\ttest_must_fail git checkout start\n+'\n+\n+test_expect_success SYMLINKS 'the symlink remained' '\n+\n \ttest -h a/b\n '\n \ndiff --git a/t/t2200-add-update.sh b/t/t2200-add-update.sh\nindex b2bd419..9bf2bdf 100755\n--- a/t/t2200-add-update.sh\n+++ b/t/t2200-add-update.sh\n@@ -96,11 +96,10 @@ test_expect_success 'non-limited update in subdir leaves root alone' '\n \ttest_cmp expect actual\n '\n \n-test_expect_success SYMLINKS 'replace a file with a symlink' '\n+test_expect_success 'replace a file with a symlink' '\n \n \trm foo &&\n-\tln -s top foo &&\n-\tgit add -u -- foo\n+\ttest_ln_s_add top foo\n \n '\n \ndiff --git a/t/t3010-ls-files-killed-modified.sh b/t/t3010-ls-files-killed-modified.sh\nindex 2d0ff2d..262e617 100755\n--- a/t/t3010-ls-files-killed-modified.sh\n+++ b/t/t3010-ls-files-killed-modified.sh\n@@ -39,12 +39,7 @@ modified without reporting path9 and path10.\n \n test_expect_success 'git update-index --add to add various paths.' '\n \tdate >path0 &&\n-\tif test_have_prereq SYMLINKS\n-\tthen\n-\t\tln -s xyzzy path1\n-\telse\n-\t\tdate > path1\n-\tfi &&\n+\ttest_ln_s_add xyzzy path1 &&\n \tmkdir path2 path3 &&\n \tdate >path2/file2 &&\n \tdate >path3/file3 &&\n@@ -52,7 +47,7 @@ test_expect_success 'git update-index --add to add various paths.' '\n \tdate >path8 &&\n \t: >path9 &&\n \tdate >path10 &&\n-\tgit update-index --add -- path0 path1 path?/file? path7 path8 path9 path10 &&\n+\tgit update-index --add -- path0 path?/file? path7 path8 path9 path10 &&\n \trm -fr path?\t# leave path10 alone\n '\n \ndiff --git a/t/t3700-add.sh b/t/t3700-add.sh\nindex 874b3a6..aab86e8 100755\n--- a/t/t3700-add.sh\n+++ b/t/t3700-add.sh\n@@ -30,10 +30,9 @@ test_expect_success \\\n \t *) echo fail; git ls-files --stage xfoo1; (exit 1);;\n \t esac'\n \n-test_expect_success SYMLINKS 'git add: filemode=0 should not get confused by symlink' '\n+test_expect_success 'git add: filemode=0 should not get confused by symlink' '\n \trm -f xfoo1 &&\n-\tln -s foo xfoo1 &&\n-\tgit add xfoo1 &&\n+\ttest_ln_s_add foo xfoo1 &&\n \tcase \"`git ls-files --stage xfoo1`\" in\n \t120000\" \"*xfoo1) echo pass;;\n \t*) echo fail; git ls-files --stage xfoo1; (exit 1);;\n@@ -51,21 +50,19 @@ test_expect_success \\\n \t *) echo fail; git ls-files --stage xfoo2; (exit 1);;\n \t esac'\n \n-test_expect_success SYMLINKS 'git add: filemode=0 should not get confused by symlink' '\n+test_expect_success 'git add: filemode=0 should not get confused by symlink' '\n \trm -f xfoo2 &&\n-\tln -s foo xfoo2 &&\n-\tgit update-index --add xfoo2 &&\n+\ttest_ln_s_add foo xfoo2 &&\n \tcase \"`git ls-files --stage xfoo2`\" in\n \t120000\" \"*xfoo2) echo pass;;\n \t*) echo fail; git ls-files --stage xfoo2; (exit 1);;\n \tesac\n '\n \n-test_expect_success SYMLINKS \\\n+test_expect_success \\\n \t'git update-index --add: Test that executable bit is not used...' \\\n \t'git config core.filemode 0 &&\n-\t ln -s xfoo2 xfoo3 &&\n-\t git update-index --add xfoo3 &&\n+\t test_ln_s_add xfoo2 xfoo3 &&\t# runs git update-index --add\n \t case \"`git ls-files --stage xfoo3`\" in\n \t 120000\" \"*xfoo3) echo pass;;\n \t *) echo fail; git ls-files --stage xfoo3; (exit 1);;\ndiff --git a/t/t3903-stash.sh b/t/t3903-stash.sh\nindex 5dfbda7..8ff039b 100755\n--- a/t/t3903-stash.sh\n+++ b/t/t3903-stash.sh\n@@ -336,41 +336,58 @@ test_expect_success SYMLINKS 'stash file to symlink (full stage)' '\n \n # This test creates a commit with a symlink used for the following tests\n \n-test_expect_success SYMLINKS 'stash symlink to file' '\n+test_expect_success 'stash symlink to file' '\n \tgit reset --hard &&\n-\tln -s file filelink &&\n-\tgit add filelink &&\n+\ttest_ln_s_add file filelink &&\n \tgit commit -m \"Add symlink\" &&\n \trm filelink &&\n \tcp file filelink &&\n-\tgit stash save \"symlink to file\" &&\n+\tgit stash save \"symlink to file\"\n+'\n+\n+test_expect_success SYMLINKS 'this must have re-created the symlink' '\n \ttest -h filelink &&\n-\tcase \"$(ls -l filelink)\" in *\" filelink -> file\") :;; *) false;; esac &&\n+\tcase \"$(ls -l filelink)\" in *\" filelink -> file\") :;; *) false;; esac\n+'\n+\n+test_expect_success 'unstash must re-create the file' '\n \tgit stash apply &&\n \t! test -h filelink &&\n \ttest bar = \"$(cat file)\"\n '\n \n-test_expect_success SYMLINKS 'stash symlink to file (stage rm)' '\n+test_expect_success 'stash symlink to file (stage rm)' '\n \tgit reset --hard &&\n \tgit rm filelink &&\n \tcp file filelink &&\n-\tgit stash save \"symlink to file (stage rm)\" &&\n+\tgit stash save \"symlink to file (stage rm)\"\n+'\n+\n+test_expect_success SYMLINKS 'this must have re-created the symlink' '\n \ttest -h filelink &&\n-\tcase \"$(ls -l filelink)\" in *\" filelink -> file\") :;; *) false;; esac &&\n+\tcase \"$(ls -l filelink)\" in *\" filelink -> file\") :;; *) false;; esac\n+'\n+\n+test_expect_success 'unstash must re-create the file' '\n \tgit stash apply &&\n \t! test -h filelink &&\n \ttest bar = \"$(cat file)\"\n '\n \n-test_expect_success SYMLINKS 'stash symlink to file (full stage)' '\n+test_expect_success 'stash symlink to file (full stage)' '\n \tgit reset --hard &&\n \trm filelink &&\n \tcp file filelink &&\n \tgit add filelink &&\n-\tgit stash save \"symlink to file (full stage)\" &&\n+\tgit stash save \"symlink to file (full stage)\"\n+'\n+\n+test_expect_success SYMLINKS 'this must have re-created the symlink' '\n \ttest -h filelink &&\n-\tcase \"$(ls -l filelink)\" in *\" filelink -> file\") :;; *) false;; esac &&\n+\tcase \"$(ls -l filelink)\" in *\" filelink -> file\") :;; *) false;; esac\n+'\n+\n+test_expect_success 'unstash must re-create the file' '\n \tgit stash apply &&\n \t! test -h filelink &&\n \ttest bar = \"$(cat file)\"\ndiff --git a/t/t4008-diff-break-rewrite.sh b/t/t4008-diff-break-rewrite.sh\nindex 73b4a24..27e98a8 100755\n--- a/t/t4008-diff-break-rewrite.sh\n+++ b/t/t4008-diff-break-rewrite.sh\n@@ -99,11 +99,11 @@ test_expect_success \\\n     'validate result of -B -M (#4)' \\\n     'compare_diff_raw expected current'\n \n-test_expect_success SYMLINKS \\\n+test_expect_success \\\n     'make file0 into something completely different' \\\n     'rm -f file0 &&\n-     ln -s frotz file0 &&\n-     git update-index file0 file1'\n+     test_ln_s_add frotz file0 &&\n+     git update-index file1'\n \n test_expect_success \\\n     'run diff with -B' \\\n@@ -114,7 +114,7 @@ cat >expected <<\\EOF\n :100644 100644 6ff87c4664981e4397625791c8ea3bbb5f2279a3 f5deac7be59e7eeab8657fd9ae706fd6a57daed2 M100\tfile1\n EOF\n \n-test_expect_success SYMLINKS \\\n+test_expect_success \\\n     'validate result of -B (#5)' \\\n     'compare_diff_raw expected current'\n \n@@ -129,7 +129,7 @@ cat >expected <<\\EOF\n :100644 100644 6ff87c4664981e4397625791c8ea3bbb5f2279a3 f5deac7be59e7eeab8657fd9ae706fd6a57daed2 R\tfile0\tfile1\n EOF\n \n-test_expect_success SYMLINKS \\\n+test_expect_success \\\n     'validate result of -B -M (#6)' \\\n     'compare_diff_raw expected current'\n \n@@ -144,7 +144,7 @@ cat >expected <<\\EOF\n :100644 100644 6ff87c4664981e4397625791c8ea3bbb5f2279a3 f5deac7be59e7eeab8657fd9ae706fd6a57daed2 M\tfile1\n EOF\n \n-test_expect_success SYMLINKS \\\n+test_expect_success \\\n     'validate result of -M (#7)' \\\n     'compare_diff_raw expected current'\n \ndiff --git a/t/t4030-diff-textconv.sh b/t/t4030-diff-textconv.sh\nindex 53ec330..f75f46f 100755\n--- a/t/t4030-diff-textconv.sh\n+++ b/t/t4030-diff-textconv.sh\n@@ -139,12 +139,10 @@ index 0000000..67be421\n +frotz\n \\ No newline at end of file\n EOF\n-# make a symlink the hard way that works on symlink-challenged file systems\n+\n test_expect_success 'textconv does not act on symlinks' '\n-\tprintf frotz > file &&\n-\tgit add file &&\n-\tgit ls-files -s | sed -e s/100644/120000/ |\n-\t\tgit update-index --index-info &&\n+\trm -f file &&\n+\ttest_ln_s_add frotz file &&\n \tgit commit -m typechange &&\n \tgit show >diff &&\n \tfind_diff <diff >actual &&\ndiff --git a/t/t4115-apply-symlink.sh b/t/t4115-apply-symlink.sh\nindex 7674dd2..872fcda 100755\n--- a/t/t4115-apply-symlink.sh\n+++ b/t/t4115-apply-symlink.sh\n@@ -9,18 +9,16 @@ test_description='git apply symlinks and partial files\n \n . ./test-lib.sh\n \n-test_expect_success SYMLINKS setup '\n+test_expect_success setup '\n \n-\tln -s path1/path2/path3/path4/path5 link1 &&\n-\tgit add link? &&\n+\ttest_ln_s_add path1/path2/path3/path4/path5 link1 &&\n \tgit commit -m initial &&\n \n \tgit branch side &&\n \n \trm -f link? &&\n \n-\tln -s htap6 link1 &&\n-\tgit update-index link? &&\n+\ttest_ln_s_add htap6 link1 &&\n \tgit commit -m second &&\n \n \tgit diff-tree -p HEAD^ HEAD >patch  &&\n@@ -37,7 +35,7 @@ test_expect_success SYMLINKS 'apply symlink patch' '\n \n '\n \n-test_expect_success SYMLINKS 'apply --index symlink patch' '\n+test_expect_success 'apply --index symlink patch' '\n \n \tgit checkout -f side &&\n \tgit apply --index patch &&\ndiff --git a/t/t4122-apply-symlink-inside.sh b/t/t4122-apply-symlink-inside.sh\nindex 3940737..70b3a06 100755\n--- a/t/t4122-apply-symlink-inside.sh\n+++ b/t/t4122-apply-symlink-inside.sh\n@@ -10,11 +10,11 @@ lecho () {\n \tdone\n }\n \n-test_expect_success SYMLINKS setup '\n+test_expect_success setup '\n \n \tmkdir -p arch/i386/boot arch/x86_64 &&\n \tlecho 1 2 3 4 5 >arch/i386/boot/Makefile &&\n-\tln -s ../i386/boot arch/x86_64/boot &&\n+\ttest_ln_s_add ../i386/boot arch/x86_64/boot &&\n \tgit add . &&\n \ttest_tick &&\n \tgit commit -m initial &&\n@@ -31,7 +31,7 @@ test_expect_success SYMLINKS setup '\n \n '\n \n-test_expect_success SYMLINKS apply '\n+test_expect_success apply '\n \n \tgit checkout test &&\n \tgit diff --exit-code test &&\n@@ -40,7 +40,7 @@ test_expect_success SYMLINKS apply '\n \n '\n \n-test_expect_success SYMLINKS 'check result' '\n+test_expect_success 'check result' '\n \n \tgit diff --exit-code master &&\n \tgit diff --exit-code --cached master &&\ndiff --git a/t/t7001-mv.sh b/t/t7001-mv.sh\nindex a845b15..101816e 100755\n--- a/t/t7001-mv.sh\n+++ b/t/t7001-mv.sh\n@@ -218,13 +218,13 @@ test_expect_success 'git mv should not change sha1 of moved cache entry' '\n \n rm -f dirty dirty2\n \n-test_expect_success SYMLINKS 'git mv should overwrite symlink to a file' '\n+test_expect_success 'git mv should overwrite symlink to a file' '\n \n \trm -fr .git &&\n \tgit init &&\n \techo 1 >moved &&\n-\tln -s moved symlink &&\n-\tgit add moved symlink &&\n+\ttest_ln_s_add moved symlink &&\n+\tgit add moved &&\n \ttest_must_fail git mv moved symlink &&\n \tgit mv -f moved symlink &&\n \t! test -e moved &&\n@@ -237,22 +237,26 @@ test_expect_success SYMLINKS 'git mv should overwrite symlink to a file' '\n \n rm -f moved symlink\n \n-test_expect_success SYMLINKS 'git mv should overwrite file with a symlink' '\n+test_expect_success 'git mv should overwrite file with a symlink' '\n \n \trm -fr .git &&\n \tgit init &&\n \techo 1 >moved &&\n-\tln -s moved symlink &&\n-\tgit add moved symlink &&\n+\ttest_ln_s_add moved symlink &&\n+\tgit add moved &&\n \ttest_must_fail git mv symlink moved &&\n \tgit mv -f symlink moved &&\n \t! test -e symlink &&\n-\ttest -h moved &&\n \tgit update-index --refresh &&\n \tgit diff-files --quiet\n \n '\n \n+test_expect_success SYMLINKS 'check moved symlink' '\n+\n+\ttest -h moved\n+'\n+\n rm -f moved symlink\n \n test_done\ndiff --git a/t/t7607-merge-overwrite.sh b/t/t7607-merge-overwrite.sh\nindex 6547eb8..758a623 100755\n--- a/t/t7607-merge-overwrite.sh\n+++ b/t/t7607-merge-overwrite.sh\n@@ -141,11 +141,10 @@ test_expect_success SYMLINKS 'will not overwrite untracked symlink in leading pa\n \ttest_path_is_missing .git/MERGE_HEAD\n '\n \n-test_expect_success SYMLINKS 'will not be confused by symlink in leading path' '\n+test_expect_success 'will not be confused by symlink in leading path' '\n \tgit reset --hard c0 &&\n \trm -rf sub &&\n-\tln -s sub2 sub &&\n-\tgit add sub &&\n+\ttest_ln_s_add sub2 sub &&\n \tgit commit -m ln &&\n \tgit checkout sub\n '\ndiff --git a/t/t8006-blame-textconv.sh b/t/t8006-blame-textconv.sh\nindex bf6caa4..7683515 100755\n--- a/t/t8006-blame-textconv.sh\n+++ b/t/t8006-blame-textconv.sh\n@@ -18,17 +18,13 @@ test_expect_success 'setup ' '\n \techo \"bin: test number 0\" >zero.bin &&\n \techo \"bin: test 1\" >one.bin &&\n \techo \"bin: test number 2\" >two.bin &&\n-\tif test_have_prereq SYMLINKS; then\n-\t\tln -s one.bin symlink.bin\n-\tfi &&\n+\ttest_ln_s_add one.bin symlink.bin &&\n \tgit add . &&\n \tGIT_AUTHOR_NAME=Number1 git commit -a -m First --date=\"2010-01-01 18:00:00\" &&\n \techo \"bin: test 1 version 2\" >one.bin &&\n \techo \"bin: test number 2 version 2\" >>two.bin &&\n-\tif test_have_prereq SYMLINKS; then\n-\t\trm symlink.bin &&\n-\t\tln -s two.bin symlink.bin\n-\tfi &&\n+\trm -f symlink.bin &&\n+\ttest_ln_s_add two.bin symlink.bin &&\n \tGIT_AUTHOR_NAME=Number2 git commit -a -m Second --date=\"2010-01-01 20:00:00\"\n '\n \n@@ -135,7 +131,7 @@ test_expect_success SYMLINKS 'blame --textconv (on symlink)' '\n \n # cp two.bin three.bin  and make small tweak\n # (this will direct blame -C -C three.bin to consider two.bin and symlink.bin)\n-test_expect_success SYMLINKS 'make another new commit' '\n+test_expect_success 'make another new commit' '\n \tcat >three.bin <<\\EOF &&\n bin: test number 2\n bin: test number 2 version 2\n@@ -146,7 +142,7 @@ EOF\n \tGIT_AUTHOR_NAME=Number4 git commit -a -m Fourth --date=\"2010-01-01 23:00:00\"\n '\n \n-test_expect_success SYMLINKS 'blame on last commit (-C -C, symlink)' '\n+test_expect_success 'blame on last commit (-C -C, symlink)' '\n \tgit blame -C -C three.bin >blame &&\n \tfind_blame <blame >result &&\n \tcat >expected <<\\EOF &&\ndiff --git a/t/t8007-cat-file-textconv.sh b/t/t8007-cat-file-textconv.sh\nindex 78a0085..b95e102 100755\n--- a/t/t8007-cat-file-textconv.sh\n+++ b/t/t8007-cat-file-textconv.sh\n@@ -12,9 +12,7 @@ chmod +x helper\n \n test_expect_success 'setup ' '\n \techo \"bin: test\" >one.bin &&\n-\tif test_have_prereq SYMLINKS; then\n-\t\tln -s one.bin symlink.bin\n-\tfi &&\n+\ttest_ln_s_add one.bin symlink.bin &&\n \tgit add . &&\n \tGIT_AUTHOR_NAME=Number1 git commit -a -m First --date=\"2010-01-01 18:00:00\" &&\n \techo \"bin: test version 2\" >one.bin &&\n@@ -72,14 +70,14 @@ test_expect_success 'cat-file --textconv on previous commit' '\n \ttest_cmp expected result\n '\n \n-test_expect_success SYMLINKS 'cat-file without --textconv (symlink)' '\n+test_expect_success 'cat-file without --textconv (symlink)' '\n \tgit cat-file blob :symlink.bin >result &&\n \tprintf \"%s\" \"one.bin\" >expected\n \ttest_cmp expected result\n '\n \n \n-test_expect_success SYMLINKS 'cat-file --textconv on index (symlink)' '\n+test_expect_success 'cat-file --textconv on index (symlink)' '\n \t! git cat-file --textconv :symlink.bin 2>result &&\n \tcat >expected <<\\EOF &&\n fatal: git cat-file --textconv: unable to run textconv on :symlink.bin\n@@ -87,7 +85,7 @@ EOF\n \ttest_cmp expected result\n '\n \n-test_expect_success SYMLINKS 'cat-file --textconv on HEAD (symlink)' '\n+test_expect_success 'cat-file --textconv on HEAD (symlink)' '\n \t! git cat-file --textconv HEAD:symlink.bin 2>result &&\n \tcat >expected <<EOF &&\n fatal: git cat-file --textconv: unable to run textconv on HEAD:symlink.bin\ndiff --git a/t/t9350-fast-export.sh b/t/t9350-fast-export.sh\nindex 2471bc6..34c2d8f 100755\n--- a/t/t9350-fast-export.sh\n+++ b/t/t9350-fast-export.sh\n@@ -396,7 +396,7 @@ test_expect_success 'tree_tag-obj'    'git fast-export tree_tag-obj'\n test_expect_success 'tag-obj_tag'     'git fast-export tag-obj_tag'\n test_expect_success 'tag-obj_tag-obj' 'git fast-export tag-obj_tag-obj'\n \n-test_expect_success SYMLINKS 'directory becomes symlink'        '\n+test_expect_success 'directory becomes symlink'        '\n \tgit init dirtosymlink &&\n \tgit init result &&\n \t(\n@@ -408,8 +408,7 @@ test_expect_success SYMLINKS 'directory becomes symlink'        '\n \t\tgit add foo/world bar/world &&\n \t\tgit commit -q -mone &&\n \t\tgit rm -r foo &&\n-\t\tln -s bar foo &&\n-\t\tgit add foo &&\n+\t\ttest_ln_s_add bar foo &&\n \t\tgit commit -q -mtwo\n \t) &&\n \t(\ndiff --git a/t/t9500-gitweb-standalone-no-errors.sh b/t/t9500-gitweb-standalone-no-errors.sh\nindex 6783c14..6fca193 100755\n--- a/t/t9500-gitweb-standalone-no-errors.sh\n+++ b/t/t9500-gitweb-standalone-no-errors.sh\n@@ -156,10 +156,10 @@ test_expect_success \\\n \t git commit -a -m \"File renamed.\" &&\n \t gitweb_run \"p=.git;a=commitdiff\"'\n \n-test_expect_success SYMLINKS \\\n+test_expect_success \\\n \t'commitdiff(0): file to symlink' \\\n \t'rm renamed_file &&\n-\t ln -s file renamed_file &&\n+\t test_ln_s_add file renamed_file &&\n \t git commit -a -m \"File to symlink.\" &&\n \t gitweb_run \"p=.git;a=commitdiff\"'\n \n@@ -212,15 +212,14 @@ test_expect_success \\\n # ----------------------------------------------------------------------\n # commitdiff testing (taken from t4114-apply-typechange.sh)\n \n-test_expect_success SYMLINKS 'setup typechange commits' '\n+test_expect_success 'setup typechange commits' '\n \techo \"hello world\" > foo &&\n \techo \"hi planet\" > bar &&\n \tgit update-index --add foo bar &&\n \tgit commit -m initial &&\n \tgit branch initial &&\n \trm -f foo &&\n-\tln -s bar foo &&\n-\tgit update-index foo &&\n+\ttest_ln_s_add bar foo &&\n \tgit commit -m \"foo symlinked to bar\" &&\n \tgit branch foo-symlinked-to-bar &&\n \trm -f foo &&\n@@ -361,11 +360,7 @@ test_expect_success \\\n \t echo \"Changed\" >> 04-rename-to &&\n \t test_chmod +x 05-mode-change &&\n \t rm -f 06-file-or-symlink &&\n-\t if test_have_prereq SYMLINKS; then\n-\t\tln -s 01-change 06-file-or-symlink\n-\t else\n-\t\tprintf %s 01-change > 06-file-or-symlink\n-\t fi &&\n+\t test_ln_s_add 01-change 06-file-or-symlink &&\n \t echo \"Changed and have mode changed\" > 07-change-mode-change\t&&\n \t test_chmod +x 07-change-mode-change &&\n \t git commit -a -m \"Large commit\" &&\n-- \n1.8.3.rc1.32.g8b61cbb\n"},{"id":"219709","messageId":"798651d401ecb522aee41a4dddd80ff5701508f6.1370636706.git.j6t@kdbg.org","threadId":"34006","inReplyTo":"cover.1370076477.git.j6t@kdbg.org","subject":"[PATCH v2 05/10] t0000: use test_ln_s_add to remove SYMLINKS prerequisite","fromName":"Johannes Sixt","fromEmail":"j6t@kdbg.org","sentAt":"2013-06-07T20:53:29Z","receivedAt":"2013-06-07T20:53:29Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"t0000-basic hard-codes many object IDs. To cater to file systems that do\nnot support symbolic links, different IDs are used depending on the\nSYMLINKS prerequisite. But we can observe the symbolic links are only\nneeded to generate index entries. Use test_ln_s_add to generate the\nindex entries and get rid of explicit SYMLINKS checks.\n\nThis undoes the special casing introduced in this test by 704a3143\n(Use prerequisite tags to skip tests that depend on symbolic links,\n2009-03-04).\n\nSigned-off-by: Johannes Sixt <j6t@kdbg.org>\n---\n t/t0000-basic.sh | 39 ++++++++++-----------------------------\n 1 file changed, 10 insertions(+), 29 deletions(-)\n\ndiff --git a/t/t0000-basic.sh b/t/t0000-basic.sh\nindex cefe33d..0f13180 100755\n--- a/t/t0000-basic.sh\n+++ b/t/t0000-basic.sh\n@@ -367,22 +367,6 @@ test_expect_success 'validate object ID of a known tree' '\n \n # Various types of objects\n \n-# Some filesystems do not support symblic links; on such systems\n-# some expected values are different\n-if test_have_prereq SYMLINKS\n-then\n-\texpectfilter=cat\n-\texpectedtree=087704a96baf1c2d1c869a8b084481e121c88b5b\n-\texpectedptree1=21ae8269cacbe57ae09138dcc3a2887f904d02b3\n-\texpectedptree2=3c5e5399f3a333eddecce7a9b9465b63f65f51e2\n-else\n-\texpectfilter='grep -v sym'\n-\texpectedtree=8e18edf7d7edcf4371a3ac6ae5f07c2641db7c46\n-\texpectedptree1=cfb8591b2f65de8b8cc1020cd7d9e67e7793b325\n-\texpectedptree2=ce580448f0148b985a513b693fdf7d802cacb44f\n-fi\n-\n-\n test_expect_success 'adding various types of objects with git update-index --add' '\n \tmkdir path2 path3 path3/subp3 &&\n \tpaths=\"path0 path2/file2 path3/file3 path3/subp3/file3\" &&\n@@ -390,10 +374,7 @@ test_expect_success 'adding various types of objects with git update-index --add\n \t\tfor p in $paths\n \t\tdo\n \t\t\techo \"hello $p\" >$p || exit 1\n-\t\t\tif test_have_prereq SYMLINKS\n-\t\t\tthen\n-\t\t\t\tln -s \"hello $p\" ${p}sym || exit 1\n-\t\t\tfi\n+\t\t\ttest_ln_s_add \"hello $p\" ${p}sym || exit 1\n \t\tdone\n \t) &&\n \tfind path* ! -type d -print | xargs git update-index --add\n@@ -405,7 +386,7 @@ test_expect_success 'showing stage with git ls-files --stage' '\n '\n \n test_expect_success 'validate git ls-files output for a known tree' '\n-\t$expectfilter >expected <<-\\EOF &&\n+\tcat >expected <<-\\EOF &&\n \t100644 f87290f8eb2cbbea7857214459a0739927eab154 0\tpath0\n \t120000 15a98433ae33114b085f3eb3bb03b832b3180a01 0\tpath0sym\n \t100644 3feff949ed00a62d9f7af97c15cd8a30595e7ac7 0\tpath2/file2\n@@ -423,14 +404,14 @@ test_expect_success 'writing tree out with git write-tree' '\n '\n \n test_expect_success 'validate object ID for a known tree' '\n-\ttest \"$tree\" = \"$expectedtree\"\n+\ttest \"$tree\" = 087704a96baf1c2d1c869a8b084481e121c88b5b\n '\n \n test_expect_success 'showing tree with git ls-tree' '\n     git ls-tree $tree >current\n '\n \n-test_expect_success SYMLINKS 'git ls-tree output for a known tree' '\n+test_expect_success 'git ls-tree output for a known tree' '\n \tcat >expected <<-\\EOF &&\n \t100644 blob f87290f8eb2cbbea7857214459a0739927eab154\tpath0\n \t120000 blob 15a98433ae33114b085f3eb3bb03b832b3180a01\tpath0sym\n@@ -447,7 +428,7 @@ test_expect_success 'showing tree with git ls-tree -r' '\n '\n \n test_expect_success 'git ls-tree -r output for a known tree' '\n-\t$expectfilter >expected <<-\\EOF &&\n+\tcat >expected <<-\\EOF &&\n \t100644 blob f87290f8eb2cbbea7857214459a0739927eab154\tpath0\n \t120000 blob 15a98433ae33114b085f3eb3bb03b832b3180a01\tpath0sym\n \t100644 blob 3feff949ed00a62d9f7af97c15cd8a30595e7ac7\tpath2/file2\n@@ -465,7 +446,7 @@ test_expect_success 'showing tree with git ls-tree -r -t' '\n \tgit ls-tree -r -t $tree >current\n '\n \n-test_expect_success SYMLINKS 'git ls-tree -r output for a known tree' '\n+test_expect_success 'git ls-tree -r output for a known tree' '\n \tcat >expected <<-\\EOF &&\n \t100644 blob f87290f8eb2cbbea7857214459a0739927eab154\tpath0\n \t120000 blob 15a98433ae33114b085f3eb3bb03b832b3180a01\tpath0sym\n@@ -487,7 +468,7 @@ test_expect_success 'writing partial tree out with git write-tree --prefix' '\n '\n \n test_expect_success 'validate object ID for a known tree' '\n-\ttest \"$ptree\" = \"$expectedptree1\"\n+\ttest \"$ptree\" = 21ae8269cacbe57ae09138dcc3a2887f904d02b3\n '\n \n test_expect_success 'writing partial tree out with git write-tree --prefix' '\n@@ -495,7 +476,7 @@ test_expect_success 'writing partial tree out with git write-tree --prefix' '\n '\n \n test_expect_success 'validate object ID for a known tree' '\n-\ttest \"$ptree\" = \"$expectedptree2\"\n+\ttest \"$ptree\" = 3c5e5399f3a333eddecce7a9b9465b63f65f51e2\n '\n \n test_expect_success 'put invalid objects into the index' '\n@@ -529,7 +510,7 @@ test_expect_success 'git read-tree followed by write-tree should be idempotent'\n '\n \n test_expect_success 'validate git diff-files output for a know cache/work tree state' '\n-\t$expectfilter >expected <<\\EOF &&\n+\tcat >expected <<\\EOF &&\n :100644 100644 f87290f8eb2cbbea7857214459a0739927eab154 0000000000000000000000000000000000000000 M\tpath0\n :120000 120000 15a98433ae33114b085f3eb3bb03b832b3180a01 0000000000000000000000000000000000000000 M\tpath0sym\n :100644 100644 3feff949ed00a62d9f7af97c15cd8a30595e7ac7 0000000000000000000000000000000000000000 M\tpath2/file2\n@@ -553,7 +534,7 @@ test_expect_success 'no diff after checkout and git update-index --refresh' '\n '\n \n ################################################################\n-P=$expectedtree\n+P=087704a96baf1c2d1c869a8b084481e121c88b5b\n \n test_expect_success 'git commit-tree records the correct tree in a commit' '\n \tcommit0=$(echo NO | git commit-tree $P) &&\n-- \n1.8.3.rc1.32.g8b61cbb\n"},{"id":"219707","messageId":"a367d65ac4c2209bab241d2bb05bbc7d257644e1.1370636706.git.j6t@kdbg.org","threadId":"34006","inReplyTo":"cover.1370076477.git.j6t@kdbg.org","subject":"[PATCH v2 06/10] t3030: use test_ln_s_add to remove SYMLINKS prerequisite","fromName":"Johannes Sixt","fromEmail":"j6t@kdbg.org","sentAt":"2013-06-07T20:53:30Z","receivedAt":"2013-06-07T20:53:30Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"The test cases include many corner-cases of merge-recursive's behavior,\nsome of them involve type changes and symbolic links. All cases, including\nthose that are protected by SYMLINKS check only whether the result of\nmerge-recursive is correctly stored in the database and the index; the\nfile system is not investigated. Use test_ln_s_add to enter a symbolic\nlink in the index in the test setup and run the tests without the\nSYMLINKS prerequisite.\n\nNotice that one test that has the SYMLINKS protection removed is an\nexpect_failure. There is a possibility that the test fails differently\ndepending on whether SYMLINKS is present or not; but this is not the case\npresently.\n\nSigned-off-by: Johannes Sixt <j6t@kdbg.org>\n---\n t/t3030-merge-recursive.sh | 62 +++++++++++++++++++---------------------------\n 1 file changed, 26 insertions(+), 36 deletions(-)\n\ndiff --git a/t/t3030-merge-recursive.sh b/t/t3030-merge-recursive.sh\nindex a5e3da7..2f96100 100755\n--- a/t/t3030-merge-recursive.sh\n+++ b/t/t3030-merge-recursive.sh\n@@ -25,10 +25,7 @@ test_expect_success 'setup 1' '\n \tgit branch submod &&\n \tgit branch copy &&\n \tgit branch rename &&\n-\tif test_have_prereq SYMLINKS\n-\tthen\n-\t\tgit branch rename-ln\n-\tfi &&\n+\tgit branch rename-ln &&\n \n \techo hello >>a &&\n \tcp a d/e &&\n@@ -260,16 +257,12 @@ test_expect_success 'setup 8' '\n \tgit add e &&\n \ttest_tick &&\n \tgit commit -m \"rename a->e\" &&\n-\tif test_have_prereq SYMLINKS\n-\tthen\n-\t\tgit checkout rename-ln &&\n-\t\tgit mv a e &&\n-\t\tln -s e a &&\n-\t\tgit add a e &&\n-\t\ttest_tick &&\n-\t\tgit commit -m \"rename a->e, symlink a->e\" &&\n-\t\toln=`printf e | git hash-object --stdin`\n-\tfi\n+\tgit checkout rename-ln &&\n+\tgit mv a e &&\n+\ttest_ln_s_add e a &&\n+\ttest_tick &&\n+\tgit commit -m \"rename a->e, symlink a->e\" &&\n+\toln=`printf e | git hash-object --stdin`\n '\n \n test_expect_success 'setup 9' '\n@@ -569,28 +562,25 @@ test_expect_success 'merge-recursive copy vs. rename' '\n \ttest_cmp expected actual\n '\n \n-if test_have_prereq SYMLINKS\n-then\n-\ttest_expect_failure 'merge-recursive rename vs. rename/symlink' '\n-\n-\t\tgit checkout -f rename &&\n-\t\tgit merge rename-ln &&\n-\t\t( git ls-tree -r HEAD ; git ls-files -s ) >actual &&\n-\t\t(\n-\t\t\techo \"120000 blob $oln\ta\"\n-\t\t\techo \"100644 blob $o0\tb\"\n-\t\t\techo \"100644 blob $o0\tc\"\n-\t\t\techo \"100644 blob $o0\td/e\"\n-\t\t\techo \"100644 blob $o0\te\"\n-\t\t\techo \"120000 $oln 0\ta\"\n-\t\t\techo \"100644 $o0 0\tb\"\n-\t\t\techo \"100644 $o0 0\tc\"\n-\t\t\techo \"100644 $o0 0\td/e\"\n-\t\t\techo \"100644 $o0 0\te\"\n-\t\t) >expected &&\n-\t\ttest_cmp expected actual\n-\t'\n-fi\n+test_expect_failure 'merge-recursive rename vs. rename/symlink' '\n+\n+\tgit checkout -f rename &&\n+\tgit merge rename-ln &&\n+\t( git ls-tree -r HEAD ; git ls-files -s ) >actual &&\n+\t(\n+\t\techo \"120000 blob $oln\ta\"\n+\t\techo \"100644 blob $o0\tb\"\n+\t\techo \"100644 blob $o0\tc\"\n+\t\techo \"100644 blob $o0\td/e\"\n+\t\techo \"100644 blob $o0\te\"\n+\t\techo \"120000 $oln 0\ta\"\n+\t\techo \"100644 $o0 0\tb\"\n+\t\techo \"100644 $o0 0\tc\"\n+\t\techo \"100644 $o0 0\td/e\"\n+\t\techo \"100644 $o0 0\te\"\n+\t) >expected &&\n+\ttest_cmp expected actual\n+'\n \n \n test_done\n-- \n1.8.3.rc1.32.g8b61cbb\n"},{"id":"219708","messageId":"ef63a9a666043849a4db98486b6886be2878c52b.1370636706.git.j6t@kdbg.org","threadId":"34006","inReplyTo":"cover.1370076477.git.j6t@kdbg.org","subject":"[PATCH v2 07/10] t3100: use test_ln_s_add to remove SYMLINKS prerequisite","fromName":"Johannes Sixt","fromEmail":"j6t@kdbg.org","sentAt":"2013-06-07T20:53:31Z","receivedAt":"2013-06-07T20:53:31Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"This undoes the special casing introduced in this test by 704a3143\n(Use prerequisite tags to skip tests that depend on symbolic links,\n2009-03-04).\n\nSigned-off-by: Johannes Sixt <j6t@kdbg.org>\n---\n t/t3100-ls-tree-restrict.sh | 42 +++++++++++++++---------------------------\n 1 file changed, 15 insertions(+), 27 deletions(-)\n\ndiff --git a/t/t3100-ls-tree-restrict.sh b/t/t3100-ls-tree-restrict.sh\nindex 81d90b6..eb73c06 100755\n--- a/t/t3100-ls-tree-restrict.sh\n+++ b/t/t3100-ls-tree-restrict.sh\n@@ -22,20 +22,8 @@ test_expect_success \\\n     'setup' \\\n     'mkdir path2 path2/baz &&\n      echo Hi >path0 &&\n-     if test_have_prereq SYMLINKS\n-     then\n-\tln -s path0 path1 &&\n-\tln -s ../path1 path2/bazbo\n-\tmake_expected () {\n-\t\tcat >expected\n-\t}\n-     else\n-\tprintf path0 > path1 &&\n-\tprintf ../path1 > path2/bazbo\n-\tmake_expected () {\n-\t\tsed -e \"s/120000 /100644 /\" >expected\n-\t}\n-     fi &&\n+     test_ln_s_add path0 path1 &&\n+     test_ln_s_add ../path1 path2/bazbo &&\n      echo Lo >path2/foo &&\n      echo Mi >path2/baz/b &&\n      find path? \\( -type f -o -type l \\) -print |\n@@ -51,7 +39,7 @@ test_output () {\n test_expect_success \\\n     'ls-tree plain' \\\n     'git ls-tree $tree >current &&\n-     make_expected <<\\EOF &&\n+     cat >expected <<\\EOF &&\n 100644 blob X\tpath0\n 120000 blob X\tpath1\n 040000 tree X\tpath2\n@@ -61,7 +49,7 @@ EOF\n test_expect_success \\\n     'ls-tree recursive' \\\n     'git ls-tree -r $tree >current &&\n-     make_expected <<\\EOF &&\n+     cat >expected <<\\EOF &&\n 100644 blob X\tpath0\n 120000 blob X\tpath1\n 100644 blob X\tpath2/baz/b\n@@ -73,7 +61,7 @@ EOF\n test_expect_success \\\n     'ls-tree recursive with -t' \\\n     'git ls-tree -r -t $tree >current &&\n-     make_expected <<\\EOF &&\n+     cat >expected <<\\EOF &&\n 100644 blob X\tpath0\n 120000 blob X\tpath1\n 040000 tree X\tpath2\n@@ -87,7 +75,7 @@ EOF\n test_expect_success \\\n     'ls-tree recursive with -d' \\\n     'git ls-tree -r -d $tree >current &&\n-     make_expected <<\\EOF &&\n+     cat >expected <<\\EOF &&\n 040000 tree X\tpath2\n 040000 tree X\tpath2/baz\n EOF\n@@ -96,7 +84,7 @@ EOF\n test_expect_success \\\n     'ls-tree filtered with path' \\\n     'git ls-tree $tree path >current &&\n-     make_expected <<\\EOF &&\n+     cat >expected <<\\EOF &&\n EOF\n      test_output'\n \n@@ -106,7 +94,7 @@ EOF\n test_expect_success \\\n     'ls-tree filtered with path1 path0' \\\n     'git ls-tree $tree path1 path0 >current &&\n-     make_expected <<\\EOF &&\n+     cat >expected <<\\EOF &&\n 100644 blob X\tpath0\n 120000 blob X\tpath1\n EOF\n@@ -115,7 +103,7 @@ EOF\n test_expect_success \\\n     'ls-tree filtered with path0/' \\\n     'git ls-tree $tree path0/ >current &&\n-     make_expected <<\\EOF &&\n+     cat >expected <<\\EOF &&\n EOF\n      test_output'\n \n@@ -124,7 +112,7 @@ EOF\n test_expect_success \\\n     'ls-tree filtered with path2' \\\n     'git ls-tree $tree path2 >current &&\n-     make_expected <<\\EOF &&\n+     cat >expected <<\\EOF &&\n 040000 tree X\tpath2\n EOF\n      test_output'\n@@ -133,7 +121,7 @@ EOF\n test_expect_success \\\n     'ls-tree filtered with path2/' \\\n     'git ls-tree $tree path2/ >current &&\n-     make_expected <<\\EOF &&\n+     cat >expected <<\\EOF &&\n 040000 tree X\tpath2/baz\n 120000 blob X\tpath2/bazbo\n 100644 blob X\tpath2/foo\n@@ -145,7 +133,7 @@ EOF\n test_expect_success \\\n     'ls-tree filtered with path2/baz' \\\n     'git ls-tree $tree path2/baz >current &&\n-     make_expected <<\\EOF &&\n+     cat >expected <<\\EOF &&\n 040000 tree X\tpath2/baz\n EOF\n      test_output'\n@@ -153,14 +141,14 @@ EOF\n test_expect_success \\\n     'ls-tree filtered with path2/bak' \\\n     'git ls-tree $tree path2/bak >current &&\n-     make_expected <<\\EOF &&\n+     cat >expected <<\\EOF &&\n EOF\n      test_output'\n \n test_expect_success \\\n     'ls-tree -t filtered with path2/bak' \\\n     'git ls-tree -t $tree path2/bak >current &&\n-     make_expected <<\\EOF &&\n+     cat >expected <<\\EOF &&\n 040000 tree X\tpath2\n EOF\n      test_output'\n@@ -168,7 +156,7 @@ EOF\n test_expect_success \\\n     'ls-tree with one path a prefix of the other' \\\n     'git ls-tree $tree path2/baz path2/bazbo >current &&\n-     make_expected <<\\EOF &&\n+     cat >expected <<\\EOF &&\n 040000 tree X\tpath2/baz\n 120000 blob X\tpath2/bazbo\n EOF\n-- \n1.8.3.rc1.32.g8b61cbb\n"},{"id":"219711","messageId":"930f46982367764070d7fc1f6564df58dd48bc63.1370636706.git.j6t@kdbg.org","threadId":"34006","inReplyTo":"cover.1370076477.git.j6t@kdbg.org","subject":"[PATCH v2 08/10] t3509, t4023, t4114: use test_ln_s_add to remove SYMLINKS prerequisite","fromName":"Johannes Sixt","fromEmail":"j6t@kdbg.org","sentAt":"2013-06-07T20:53:32Z","receivedAt":"2013-06-07T20:53:32Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"In t4023 and t4114, we have to remove the entries using 'git rm' because\notherwise the entries that must turn from symbolic links to regular files\nwould stay symbolic links in the index. For the same reason, we have to\nuse 'git mv' instead of plain 'mv' in t3509.\n\nSigned-off-by: Johannes Sixt <j6t@kdbg.org>\n---\n t/t3509-cherry-pick-merge-df.sh   | 12 +++++-------\n t/t4023-diff-rename-typechange.sh | 28 ++++++++++++++--------------\n t/t4114-apply-typechange.sh       | 29 ++++++++++++++---------------\n 3 files changed, 33 insertions(+), 36 deletions(-)\n\ndiff --git a/t/t3509-cherry-pick-merge-df.sh b/t/t3509-cherry-pick-merge-df.sh\nindex df921d1..a5b6a5f 100755\n--- a/t/t3509-cherry-pick-merge-df.sh\n+++ b/t/t3509-cherry-pick-merge-df.sh\n@@ -10,17 +10,15 @@ test_expect_success 'Initialize repository' '\n \tgit commit -m a\n '\n \n-test_expect_success SYMLINKS 'Setup rename across paths each below D/F conflicts' '\n+test_expect_success 'Setup rename across paths each below D/F conflicts' '\n \tmkdir b &&\n-\tln -s ../a b/a &&\n-\tgit add b &&\n+\ttest_ln_s_add ../a b/a &&\n \tgit commit -m b &&\n \n \tgit checkout -b branch &&\n \trm b/a &&\n-\tmv a b/a &&\n-\tln -s b/a a &&\n-\tgit add . &&\n+\tgit mv a b/a &&\n+\ttest_ln_s_add b/a a &&\n \tgit commit -m swap &&\n \n \t>f1 &&\n@@ -28,7 +26,7 @@ test_expect_success SYMLINKS 'Setup rename across paths each below D/F conflicts\n \tgit commit -m f1\n '\n \n-test_expect_success SYMLINKS 'Cherry-pick succeeds with rename across D/F conflicts' '\n+test_expect_success 'Cherry-pick succeeds with rename across D/F conflicts' '\n \tgit reset --hard &&\n \tgit checkout master^0 &&\n \tgit cherry-pick branch\ndiff --git a/t/t4023-diff-rename-typechange.sh b/t/t4023-diff-rename-typechange.sh\nindex 5d20acf..55d549f 100755\n--- a/t/t4023-diff-rename-typechange.sh\n+++ b/t/t4023-diff-rename-typechange.sh\n@@ -4,44 +4,44 @@ test_description='typechange rename detection'\n \n . ./test-lib.sh\n \n-test_expect_success SYMLINKS setup '\n+test_expect_success setup '\n \n \trm -f foo bar &&\n \tcat \"$TEST_DIRECTORY\"/../COPYING >foo &&\n-\tln -s linklink bar &&\n-\tgit add foo bar &&\n+\ttest_ln_s_add linklink bar &&\n+\tgit add foo &&\n \tgit commit -a -m Initial &&\n \tgit tag one &&\n \n-\trm -f foo bar &&\n+\tgit rm -f foo bar &&\n \tcat \"$TEST_DIRECTORY\"/../COPYING >bar &&\n-\tln -s linklink foo &&\n-\tgit add foo bar &&\n+\ttest_ln_s_add linklink foo &&\n+\tgit add bar &&\n \tgit commit -a -m Second &&\n \tgit tag two &&\n \n-\trm -f foo bar &&\n+\tgit rm -f foo bar &&\n \tcat \"$TEST_DIRECTORY\"/../COPYING >foo &&\n \tgit add foo &&\n \tgit commit -a -m Third &&\n \tgit tag three &&\n \n \tmv foo bar &&\n-\tln -s linklink foo &&\n-\tgit add foo bar &&\n+\ttest_ln_s_add linklink foo &&\n+\tgit add bar &&\n \tgit commit -a -m Fourth &&\n \tgit tag four &&\n \n \t# This is purely for sanity check\n \n-\trm -f foo bar &&\n+\tgit rm -f foo bar &&\n \tcat \"$TEST_DIRECTORY\"/../COPYING >foo &&\n \tcat \"$TEST_DIRECTORY\"/../Makefile >bar &&\n \tgit add foo bar &&\n \tgit commit -a -m Fifth &&\n \tgit tag five &&\n \n-\trm -f foo bar &&\n+\tgit rm -f foo bar &&\n \tcat \"$TEST_DIRECTORY\"/../Makefile >foo &&\n \tcat \"$TEST_DIRECTORY\"/../COPYING >bar &&\n \tgit add foo bar &&\n@@ -50,7 +50,7 @@ test_expect_success SYMLINKS setup '\n \n '\n \n-test_expect_success SYMLINKS 'cross renames to be detected for regular files' '\n+test_expect_success 'cross renames to be detected for regular files' '\n \n \tgit diff-tree five six -r --name-status -B -M | sort >actual &&\n \t{\n@@ -61,7 +61,7 @@ test_expect_success SYMLINKS 'cross renames to be detected for regular files' '\n \n '\n \n-test_expect_success SYMLINKS 'cross renames to be detected for typechange' '\n+test_expect_success 'cross renames to be detected for typechange' '\n \n \tgit diff-tree one two -r --name-status -B -M | sort >actual &&\n \t{\n@@ -72,7 +72,7 @@ test_expect_success SYMLINKS 'cross renames to be detected for typechange' '\n \n '\n \n-test_expect_success SYMLINKS 'moves and renames' '\n+test_expect_success 'moves and renames' '\n \n \tgit diff-tree three four -r --name-status -B -M | sort >actual &&\n \t{\ndiff --git a/t/t4114-apply-typechange.sh b/t/t4114-apply-typechange.sh\nindex f12826f..ebadbc3 100755\n--- a/t/t4114-apply-typechange.sh\n+++ b/t/t4114-apply-typechange.sh\n@@ -9,20 +9,19 @@ test_description='git apply should not get confused with type changes.\n \n . ./test-lib.sh\n \n-test_expect_success SYMLINKS 'setup repository and commits' '\n+test_expect_success 'setup repository and commits' '\n \techo \"hello world\" > foo &&\n \techo \"hi planet\" > bar &&\n \tgit update-index --add foo bar &&\n \tgit commit -m initial &&\n \tgit branch initial &&\n \trm -f foo &&\n-\tln -s bar foo &&\n-\tgit update-index foo &&\n+\ttest_ln_s_add bar foo &&\n \tgit commit -m \"foo symlinked to bar\" &&\n \tgit branch foo-symlinked-to-bar &&\n-\trm -f foo &&\n+\tgit rm -f foo &&\n \techo \"how far is the sun?\" > foo &&\n-\tgit update-index foo &&\n+\tgit update-index --add foo &&\n \tgit commit -m \"foo back to file\" &&\n \tgit branch foo-back-to-file &&\n \tprintf \"\\0\" > foo &&\n@@ -42,7 +41,7 @@ test_expect_success SYMLINKS 'setup repository and commits' '\n \tgit branch foo-baz-renamed-from-foo\n \t'\n \n-test_expect_success SYMLINKS 'file renamed from foo to foo/baz' '\n+test_expect_success 'file renamed from foo to foo/baz' '\n \tgit checkout -f initial &&\n \tgit diff-tree -M -p HEAD foo-baz-renamed-from-foo > patch &&\n \tgit apply --index < patch\n@@ -50,7 +49,7 @@ test_expect_success SYMLINKS 'file renamed from foo to foo/baz' '\n test_debug 'cat patch'\n \n \n-test_expect_success SYMLINKS 'file renamed from foo/baz to foo' '\n+test_expect_success 'file renamed from foo/baz to foo' '\n \tgit checkout -f foo-baz-renamed-from-foo &&\n \tgit diff-tree -M -p HEAD initial > patch &&\n \tgit apply --index < patch\n@@ -58,7 +57,7 @@ test_expect_success SYMLINKS 'file renamed from foo/baz to foo' '\n test_debug 'cat patch'\n \n \n-test_expect_success SYMLINKS 'directory becomes file' '\n+test_expect_success 'directory becomes file' '\n \tgit checkout -f foo-becomes-a-directory &&\n \tgit diff-tree -p HEAD initial > patch &&\n \tgit apply --index < patch\n@@ -66,7 +65,7 @@ test_expect_success SYMLINKS 'directory becomes file' '\n test_debug 'cat patch'\n \n \n-test_expect_success SYMLINKS 'file becomes directory' '\n+test_expect_success 'file becomes directory' '\n \tgit checkout -f initial &&\n \tgit diff-tree -p HEAD foo-becomes-a-directory > patch &&\n \tgit apply --index < patch\n@@ -74,7 +73,7 @@ test_expect_success SYMLINKS 'file becomes directory' '\n test_debug 'cat patch'\n \n \n-test_expect_success SYMLINKS 'file becomes symlink' '\n+test_expect_success 'file becomes symlink' '\n \tgit checkout -f initial &&\n \tgit diff-tree -p HEAD foo-symlinked-to-bar > patch &&\n \tgit apply --index < patch\n@@ -82,21 +81,21 @@ test_expect_success SYMLINKS 'file becomes symlink' '\n test_debug 'cat patch'\n \n \n-test_expect_success SYMLINKS 'symlink becomes file' '\n+test_expect_success 'symlink becomes file' '\n \tgit checkout -f foo-symlinked-to-bar &&\n \tgit diff-tree -p HEAD foo-back-to-file > patch &&\n \tgit apply --index < patch\n \t'\n test_debug 'cat patch'\n \n-test_expect_success SYMLINKS 'binary file becomes symlink' '\n+test_expect_success 'binary file becomes symlink' '\n \tgit checkout -f foo-becomes-binary &&\n \tgit diff-tree -p --binary HEAD foo-symlinked-to-bar > patch &&\n \tgit apply --index < patch\n \t'\n test_debug 'cat patch'\n \n-test_expect_success SYMLINKS 'symlink becomes binary file' '\n+test_expect_success 'symlink becomes binary file' '\n \tgit checkout -f foo-symlinked-to-bar &&\n \tgit diff-tree -p --binary HEAD foo-becomes-binary > patch &&\n \tgit apply --index < patch\n@@ -104,7 +103,7 @@ test_expect_success SYMLINKS 'symlink becomes binary file' '\n test_debug 'cat patch'\n \n \n-test_expect_success SYMLINKS 'symlink becomes directory' '\n+test_expect_success 'symlink becomes directory' '\n \tgit checkout -f foo-symlinked-to-bar &&\n \tgit diff-tree -p HEAD foo-becomes-a-directory > patch &&\n \tgit apply --index < patch\n@@ -112,7 +111,7 @@ test_expect_success SYMLINKS 'symlink becomes directory' '\n test_debug 'cat patch'\n \n \n-test_expect_success SYMLINKS 'directory becomes symlink' '\n+test_expect_success 'directory becomes symlink' '\n \tgit checkout -f foo-becomes-a-directory &&\n \tgit diff-tree -p HEAD foo-symlinked-to-bar > patch &&\n \tgit apply --index < patch\n-- \n1.8.3.rc1.32.g8b61cbb\n"},{"id":"219712","messageId":"c5d6b064b466d785750d6bea22e6147037230f73.1370636706.git.j6t@kdbg.org","threadId":"34006","inReplyTo":"cover.1370076477.git.j6t@kdbg.org","subject":"[PATCH v2 09/10] t6035: use test_ln_s_add to remove SYMLINKS prerequisite","fromName":"Johannes Sixt","fromEmail":"j6t@kdbg.org","sentAt":"2013-06-07T20:53:33Z","receivedAt":"2013-06-07T20:53:33Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"All tests in t6035 are protected by SYMLINKS. But that is not necessary,\nbecause a lot of the functionality can be tested provided symbolic link\nentries enter the index and object data base. Use test_ln_s_add for this\npurpose.\n\nSome test cases do test the presence of symbolic links on the file system.\nMove these tests into separate test cases that remain protected by\nSYMLINKS.\n\nThere is one instance of expect_failure. There is a possibility that this\ntest case fails differently depending on whether SYMLINKS is present or\nnot; but this is not the case.\n\nSigned-off-by: Johannes Sixt <j6t@kdbg.org>\n---\n t/t6035-merge-dir-to-symlink.sh | 73 ++++++++++++++++++++++++++---------------\n 1 file changed, 47 insertions(+), 26 deletions(-)\n\ndiff --git a/t/t6035-merge-dir-to-symlink.sh b/t/t6035-merge-dir-to-symlink.sh\nindex 2599ae5..9324ea4 100755\n--- a/t/t6035-merge-dir-to-symlink.sh\n+++ b/t/t6035-merge-dir-to-symlink.sh\n@@ -3,7 +3,7 @@\n test_description='merging when a directory was replaced with a symlink'\n . ./test-lib.sh\n \n-test_expect_success SYMLINKS 'create a commit where dir a/b changed to symlink' '\n+test_expect_success 'create a commit where dir a/b changed to symlink' '\n \tmkdir -p a/b/c a/b-2/c &&\n \t> a/b/c/d &&\n \t> a/b-2/c/d &&\n@@ -12,12 +12,12 @@ test_expect_success SYMLINKS 'create a commit where dir a/b changed to symlink'\n \tgit commit -m base &&\n \tgit tag start &&\n \trm -rf a/b &&\n-\tln -s b-2 a/b &&\n \tgit add -A &&\n+\ttest_ln_s_add b-2 a/b &&\n \tgit commit -m \"dir to symlink\"\n '\n \n-test_expect_success SYMLINKS 'checkout does not clobber untracked symlink' '\n+test_expect_success 'checkout does not clobber untracked symlink' '\n \tgit checkout HEAD^0 &&\n \tgit reset --hard master &&\n \tgit rm --cached a/b &&\n@@ -25,7 +25,7 @@ test_expect_success SYMLINKS 'checkout does not clobber untracked symlink' '\n \ttest_must_fail git checkout start^0\n '\n \n-test_expect_success SYMLINKS 'a/b-2/c/d is kept when clobbering symlink b' '\n+test_expect_success 'a/b-2/c/d is kept when clobbering symlink b' '\n \tgit checkout HEAD^0 &&\n \tgit reset --hard master &&\n \tgit rm --cached a/b &&\n@@ -34,14 +34,14 @@ test_expect_success SYMLINKS 'a/b-2/c/d is kept when clobbering symlink b' '\n \ttest -f a/b-2/c/d\n '\n \n-test_expect_success SYMLINKS 'checkout should not have deleted a/b-2/c/d' '\n+test_expect_success 'checkout should not have deleted a/b-2/c/d' '\n \tgit checkout HEAD^0 &&\n \tgit reset --hard master &&\n \t git checkout start^0 &&\n \t test -f a/b-2/c/d\n '\n \n-test_expect_success SYMLINKS 'setup for merge test' '\n+test_expect_success 'setup for merge test' '\n \tgit reset --hard &&\n \ttest -f a/b-2/c/d &&\n \techo x > a/x &&\n@@ -50,39 +50,51 @@ test_expect_success SYMLINKS 'setup for merge test' '\n \tgit tag baseline\n '\n \n-test_expect_success SYMLINKS 'Handle D/F conflict, do not lose a/b-2/c/d in merge (resolve)' '\n+test_expect_success 'Handle D/F conflict, do not lose a/b-2/c/d in merge (resolve)' '\n \tgit reset --hard &&\n \tgit checkout baseline^0 &&\n \tgit merge -s resolve master &&\n-\ttest -h a/b &&\n \ttest -f a/b-2/c/d\n '\n \n-test_expect_success SYMLINKS 'Handle D/F conflict, do not lose a/b-2/c/d in merge (recursive)' '\n+test_expect_success SYMLINKS 'a/b was resolved as symlink' '\n+\ttest -h a/b\n+'\n+\n+test_expect_success 'Handle D/F conflict, do not lose a/b-2/c/d in merge (recursive)' '\n \tgit reset --hard &&\n \tgit checkout baseline^0 &&\n \tgit merge -s recursive master &&\n-\ttest -h a/b &&\n \ttest -f a/b-2/c/d\n '\n \n-test_expect_success SYMLINKS 'Handle F/D conflict, do not lose a/b-2/c/d in merge (resolve)' '\n+test_expect_success SYMLINKS 'a/b was resolved as symlink' '\n+\ttest -h a/b\n+'\n+\n+test_expect_success 'Handle F/D conflict, do not lose a/b-2/c/d in merge (resolve)' '\n \tgit reset --hard &&\n \tgit checkout master^0 &&\n \tgit merge -s resolve baseline^0 &&\n-\ttest -h a/b &&\n \ttest -f a/b-2/c/d\n '\n \n-test_expect_success SYMLINKS 'Handle F/D conflict, do not lose a/b-2/c/d in merge (recursive)' '\n+test_expect_success SYMLINKS 'a/b was resolved as symlink' '\n+\ttest -h a/b\n+'\n+\n+test_expect_success 'Handle F/D conflict, do not lose a/b-2/c/d in merge (recursive)' '\n \tgit reset --hard &&\n \tgit checkout master^0 &&\n \tgit merge -s recursive baseline^0 &&\n-\ttest -h a/b &&\n \ttest -f a/b-2/c/d\n '\n \n-test_expect_failure SYMLINKS 'do not lose untracked in merge (resolve)' '\n+test_expect_success SYMLINKS 'a/b was resolved as symlink' '\n+\ttest -h a/b\n+'\n+\n+test_expect_failure 'do not lose untracked in merge (resolve)' '\n \tgit reset --hard &&\n \tgit checkout baseline^0 &&\n \t>a/b/c/e &&\n@@ -91,7 +103,7 @@ test_expect_failure SYMLINKS 'do not lose untracked in merge (resolve)' '\n \ttest -f a/b-2/c/d\n '\n \n-test_expect_success SYMLINKS 'do not lose untracked in merge (recursive)' '\n+test_expect_success 'do not lose untracked in merge (recursive)' '\n \tgit reset --hard &&\n \tgit checkout baseline^0 &&\n \t>a/b/c/e &&\n@@ -100,52 +112,61 @@ test_expect_success SYMLINKS 'do not lose untracked in merge (recursive)' '\n \ttest -f a/b-2/c/d\n '\n \n-test_expect_success SYMLINKS 'do not lose modifications in merge (resolve)' '\n+test_expect_success 'do not lose modifications in merge (resolve)' '\n \tgit reset --hard &&\n \tgit checkout baseline^0 &&\n \techo more content >>a/b/c/d &&\n \ttest_must_fail git merge -s resolve master\n '\n \n-test_expect_success SYMLINKS 'do not lose modifications in merge (recursive)' '\n+test_expect_success 'do not lose modifications in merge (recursive)' '\n \tgit reset --hard &&\n \tgit checkout baseline^0 &&\n \techo more content >>a/b/c/d &&\n \ttest_must_fail git merge -s recursive master\n '\n \n-test_expect_success SYMLINKS 'setup a merge where dir a/b-2 changed to symlink' '\n+test_expect_success 'setup a merge where dir a/b-2 changed to symlink' '\n \tgit reset --hard &&\n \tgit checkout start^0 &&\n \trm -rf a/b-2 &&\n-\tln -s b a/b-2 &&\n \tgit add -A &&\n+\ttest_ln_s_add b a/b-2 &&\n \tgit commit -m \"dir a/b-2 to symlink\" &&\n \tgit tag test2\n '\n \n-test_expect_success SYMLINKS 'merge should not have D/F conflicts (resolve)' '\n+test_expect_success 'merge should not have D/F conflicts (resolve)' '\n \tgit reset --hard &&\n \tgit checkout baseline^0 &&\n \tgit merge -s resolve test2 &&\n-\ttest -h a/b-2 &&\n \ttest -f a/b/c/d\n '\n \n-test_expect_success SYMLINKS 'merge should not have D/F conflicts (recursive)' '\n+test_expect_success SYMLINKS 'a/b-2 was resolved as symlink' '\n+\ttest -h a/b-2\n+'\n+\n+test_expect_success 'merge should not have D/F conflicts (recursive)' '\n \tgit reset --hard &&\n \tgit checkout baseline^0 &&\n \tgit merge -s recursive test2 &&\n-\ttest -h a/b-2 &&\n \ttest -f a/b/c/d\n '\n \n-test_expect_success SYMLINKS 'merge should not have F/D conflicts (recursive)' '\n+test_expect_success SYMLINKS 'a/b-2 was resolved as symlink' '\n+\ttest -h a/b-2\n+'\n+\n+test_expect_success 'merge should not have F/D conflicts (recursive)' '\n \tgit reset --hard &&\n \tgit checkout -b foo test2 &&\n \tgit merge -s recursive baseline^0 &&\n-\ttest -h a/b-2 &&\n \ttest -f a/b/c/d\n '\n \n+test_expect_success SYMLINKS 'a/b-2 was resolved as symlink' '\n+\ttest -h a/b-2\n+'\n+\n test_done\n-- \n1.8.3.rc1.32.g8b61cbb\n"},{"id":"219710","messageId":"984a1c896f016201a614eeaeea700d35a82f2e32.1370636706.git.j6t@kdbg.org","threadId":"34006","inReplyTo":"cover.1370076477.git.j6t@kdbg.org","subject":"[PATCH v2 10/10] t4011: remove SYMLINKS prerequisite","fromName":"Johannes Sixt","fromEmail":"j6t@kdbg.org","sentAt":"2013-06-07T20:53:34Z","receivedAt":"2013-06-07T20:53:34Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"The part of the test that is about symbolic links in the index does not\nrequire that the corresponding file system entry is actually a symbolic\nlink. Use test_ln_s_add to insert a symbolic link in the index. When\nthe file system does not support symbolic links, we actually have a\nregular file in the worktree, which  we can update as if it were a\nsymbolic link. diff-index picks up the symbolic link property from the\nindex.\n\nSigned-off-by: Johannes Sixt <j6t@kdbg.org>\n---\n t/t4011-diff-symlink.sh | 35 +++++++++++++++++++++++++----------\n 1 file changed, 25 insertions(+), 10 deletions(-)\n\ndiff --git a/t/t4011-diff-symlink.sh b/t/t4011-diff-symlink.sh\nindex f0d5041..13e7f62 100755\n--- a/t/t4011-diff-symlink.sh\n+++ b/t/t4011-diff-symlink.sh\n@@ -9,7 +9,7 @@ test_description='Test diff of symlinks.\n . ./test-lib.sh\n . \"$TEST_DIRECTORY\"/diff-lib.sh\n \n-test_expect_success SYMLINKS 'diff new symlink and file' '\n+test_expect_success 'diff new symlink and file' '\n \tcat >expected <<-\\EOF &&\n \tdiff --git a/frotz b/frotz\n \tnew file mode 120000\n@@ -27,22 +27,25 @@ test_expect_success SYMLINKS 'diff new symlink and file' '\n \t@@ -0,0 +1 @@\n \t+xyzzy\n \tEOF\n-\tln -s xyzzy frotz &&\n-\techo xyzzy >nitfol &&\n+\n+\t# the empty tree\n \tgit update-index &&\n \ttree=$(git write-tree) &&\n-\tgit update-index --add frotz nitfol &&\n+\n+\ttest_ln_s_add xyzzy frotz &&\n+\techo xyzzy >nitfol &&\n+\tgit update-index --add nitfol &&\n \tGIT_DIFF_OPTS=--unified=0 git diff-index -M -p $tree >current &&\n \tcompare_diff_patch expected current\n '\n \n-test_expect_success SYMLINKS 'diff unchanged symlink and file'  '\n+test_expect_success 'diff unchanged symlink and file'  '\n \ttree=$(git write-tree) &&\n \tgit update-index frotz nitfol &&\n \ttest -z \"$(git diff-index --name-only $tree)\"\n '\n \n-test_expect_success SYMLINKS 'diff removed symlink and file' '\n+test_expect_success 'diff removed symlink and file' '\n \tcat >expected <<-\\EOF &&\n \tdiff --git a/frotz b/frotz\n \tdeleted file mode 120000\n@@ -66,12 +69,18 @@ test_expect_success SYMLINKS 'diff removed symlink and file' '\n \tcompare_diff_patch expected current\n '\n \n-test_expect_success SYMLINKS 'diff identical, but newly created symlink and file' '\n+test_expect_success 'diff identical, but newly created symlink and file' '\n \t>expected &&\n \trm -f frotz nitfol &&\n \techo xyzzy >nitfol &&\n \ttest-chmtime +10 nitfol &&\n-\tln -s xyzzy frotz &&\n+\tif test_have_prereq SYMLINKS\n+\tthen\n+\t\tln -s xyzzy frotz\n+\telse\n+\t\tprintf xyzzy >frotz\n+\t\t# the symlink property propagates from the index\n+\tfi &&\n \tgit diff-index -M -p $tree >current &&\n \tcompare_diff_patch expected current &&\n \n@@ -80,7 +89,7 @@ test_expect_success SYMLINKS 'diff identical, but newly created symlink and file\n \tcompare_diff_patch expected current\n '\n \n-test_expect_success SYMLINKS 'diff different symlink and file' '\n+test_expect_success 'diff different symlink and file' '\n \tcat >expected <<-\\EOF &&\n \tdiff --git a/frotz b/frotz\n \tindex 7c465af..df1db54 120000\n@@ -100,7 +109,13 @@ test_expect_success SYMLINKS 'diff different symlink and file' '\n \t+yxyyz\n \tEOF\n \trm -f frotz &&\n-\tln -s yxyyz frotz &&\n+\tif test_have_prereq SYMLINKS\n+\tthen\n+\t\tln -s yxyyz frotz\n+\telse\n+\t\tprintf yxyyz >frotz\n+\t\t# the symlink property propagates from the index\n+\tfi &&\n \techo yxyyz >nitfol &&\n \tgit diff-index -M -p $tree >current &&\n \tcompare_diff_patch expected current\n-- \n1.8.3.rc1.32.g8b61cbb\n"},{"id":"219746","messageId":"7v8v2lshkn.fsf@alter.siamese.dyndns.org","threadId":"34006","inReplyTo":"cover.1370636706.git.j6t@kdbg.org","subject":"Re: [PATCH v2 00/10] Increase test coverage on Windows by removing SYMLINKS from many tests","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-06-07T22:04:56Z","receivedAt":"2013-06-07T22:04:56Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Thanks; the interdiff looks sane.\n"},{"id":"230844","messageId":"CABPQNSYP-LzX9Truv4UmQrmYpo5fWbk1aYKpKKVaGL8POanWiQ@mail.gmail.com","threadId":"34006","inReplyTo":"ba3c59d26cfb23a8c71c66ef1d49c4dca55fc556.1370636706.git.j6t@kdbg.org","subject":"Re: [PATCH v2 01/10] test-chmtime: Fix exit code on Windows","fromName":"Erik Faye-Lund","fromEmail":"kusmabite@gmail.com","sentAt":"2013-11-20T14:00:06Z","receivedAt":"2013-11-20T14:00:06Z","isPatch":true,"sender":{"key":"kusmabite@gmail.com","avatar":"https://avatars.githubusercontent.com/u/47073?v=4"},"body":"On Fri, Jun 7, 2013 at 10:53 PM, Johannes Sixt <j6t@kdbg.org> wrote:\n> MinGW's bash does not recognize an exit code -1 as failure. See also\n> 47e3de0e (MinGW: truncate exit()'s argument to lowest 8 bits) and 2488df84\n> (builtin run_command: do not exit with -1). Exit code 1 is good enough.\n>\n> Signed-off-by: Johannes Sixt <j6t@kdbg.org>\n> ---\n>  test-chmtime.c | 8 ++++----\n>  1 file changed, 4 insertions(+), 4 deletions(-)\n>\n> diff --git a/test-chmtime.c b/test-chmtime.c\n> index 02b42ba..2e601a8 100644\n> --- a/test-chmtime.c\n> +++ b/test-chmtime.c\n> @@ -84,7 +84,7 @@ int main(int argc, const char *argv[])\n>                 if (stat(argv[i], &sb) < 0) {\n>                         fprintf(stderr, \"Failed to stat %s: %s\\n\",\n>                                 argv[i], strerror(errno));\n> -                       return -1;\n> +                       return 1;\n>                 }\n>\n>  #ifdef WIN32\n> @@ -92,7 +92,7 @@ int main(int argc, const char *argv[])\n>                                 chmod(argv[i], sb.st_mode | S_IWUSR)) {\n>                         fprintf(stderr, \"Could not make user-writable %s: %s\",\n>                                 argv[i], strerror(errno));\n> -                       return -1;\n> +                       return 1;\n>                 }\n>  #endif\n>\n> @@ -107,7 +107,7 @@ int main(int argc, const char *argv[])\n>                 if (utb.modtime != sb.st_mtime && utime(argv[i], &utb) < 0) {\n>                         fprintf(stderr, \"Failed to modify time on %s: %s\\n\",\n>                                 argv[i], strerror(errno));\n> -                       return -1;\n> +                       return 1;\n>                 }\n>         }\n>\n> @@ -115,5 +115,5 @@ int main(int argc, const char *argv[])\n>\n>  usage:\n>         fprintf(stderr, \"usage: %s %s\\n\", argv[0], usage_str);\n> -       return -1;\n> +       return 1;\n>  }\n> --\n> 1.8.3.rc1.32.g8b61cbb\n>\n> --\n> To unsubscribe from this list: send the line \"unsubscribe git\" in\n> the body of a message to majordomo@vger.kernel.org\n> More majordomo info at  http://vger.kernel.org/majordomo-info.html\n\nHmmm. Perhaps we should do something like this?\n\ndiff --git a/compat/mingw.h b/compat/mingw.h\nindex 1f9ab5f..cbee8bd 100644\n--- a/compat/mingw.h\n+++ b/compat/mingw.h\n@@ -462,7 +462,7 @@ static int mingw_main(c,v); \\\n int main(c,v) \\\n { \\\n  mingw_startup(); \\\n- return mingw_main(__argc, __argv); \\\n+ return mingw_main(__argc, __argv) & 0xff; \\\n } \\\n static int mingw_main(c,v)\n"}]}