{"thread":{"id":"18451","subject":"[PATCH 04/16] t0050: Check whether git init detected symbolic link support correctly","startedAt":"2009-03-21T21:26:23Z","lastAt":"2009-03-22T21:59:02Z","messageCount":23,"participants":["Johannes Sixt","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":16},"messages":[{"id":"108820","messageId":"cover.1237667830.git.j6t@kdbg.org","threadId":"18451","inReplyTo":null,"subject":"[PATCH 00/16] Tests on Windows - main part","fromName":"Johannes Sixt","fromEmail":"j6t@kdbg.org","sentAt":"2009-03-21T21:26:23Z","receivedAt":"2009-03-21T21:26:23Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"This is the remaining set of changes after which the test suite\npasses with the MinGW port. Well, almost: There still are a few\nfailures, but none of them indicate a serious bug. We will address\nthem later.\n\nThe series is again available from here:\n\n  git://repo.or.cz/git/mingw/j6t.git for-junio\n\nIt builds on js/windows-tests (a8cbc9ab).\n\nThe heart of this series is an addition to the test infrastructure:\nTests can be tagged by a keyword, which indicates that a particular\nfeature (\"prerequisite\") is needed. This idea was presented by Junio\nsome time ago, but I didn't save away the implementation.\n\nThe new features are used in this way:\n\n1. The prerequisite is tested for and the tag is defined:\n\n    if frob --mode=nicate 2>/dev/null; then\n\ttest_set_prereq FROBNICATE\n    else\n\tsay \"frobnication not possible, skipping some tests\n    fi\n\n2. Tests are tagged by the tag name:\n\n    test_expect_success FROBNICATE 'frobnication' '\n\tfrob --mode=nicate\n    '\n\n   Such a test is skipped if the tag was not defined before.\n\n3. The prerequisite can also be tested for explicitly:\n\n    if test_have_prereq FROBNICATE; then\n\texpect=foo\n    else\n\texpect=bar\n    fi\n\nI have considered a different approach to define prerequisites,\nnamely with a helper function that is similar to test_expect_*:\n\n    test_prereq FROBNICATE 'frobnication' '\n\tfrob --mode=nicate 2>/dev/null\n    '\n\nbut I find it a bit obfuscating.\n\nCurrently most prerequisites are tested for on demand. Symbolic\nlinks are tested for in test-lib.sh because so many test scripts\nneed it. An option would be to move each test in its own file\nthat would then be sourced on demand.\n\n\nJohannes Sixt (16):\n  test-lib: Work around incompatible sort and find on Windows\n  test-lib: Work around missing sum on Windows\n  Tests on Windows: $(pwd) must return Windows-style paths\n  t0050: Check whether git init detected symbolic link support\n    correctly\n  test-lib: Infrastructure to test and check for prerequisites\n  t3600: Use test prerequisite tags\n  Skip tests that fail if the executable bit is not handled by the\n    filesystem\n  t5302: Use prerequisite tags to skip 64-bit offset tests\n  t9100, t9129: Use prerequisite tags for UTF-8 tests\n  Use prerequisite tags to skip tests that depend on symbolic links\n  t0060: Fix tests on Windows\n  Skip tests that require a filesystem that obeys POSIX permissions\n  t3700: Skip a test with backslashes in pathspec\n  Use prerequisites to skip tests that need unzip\n  t7004: Use prerequisite tags to skip tests that need gpg\n  t5503: GIT_DEBUG_SEND_PACK is not supported on MinGW\n\n t/t0000-basic.sh                       |   58 +++++++++++++---\n t/t0004-unwritable.sh                  |    8 +-\n t/t0024-crlf-archive.sh                |    6 +-\n t/t0050-filesystem.sh                  |   28 +++++++-\n t/t0055-beyond-symlinks.sh             |    6 +-\n t/t0060-path-utils.sh                  |  116 +++++++++++++++++++++++---------\n t/t1004-read-tree-m-u-wf.sh            |    6 +-\n t/t1020-subdirectory.sh                |    2 +-\n t/t1300-repo-config.sh                 |    2 +-\n t/t1301-shared-repo.sh                 |   10 ++--\n t/t1504-ceiling-dirs.sh                |    2 +-\n t/t2001-checkout-cache-clash.sh        |    6 +-\n t/t2003-checkout-cache-mkdir.sh        |    8 +-\n t/t2004-checkout-cache-temp.sh         |    2 +-\n t/t2007-checkout-symlink.sh            |    6 ++\n t/t2100-update-cache-badpath.sh        |   14 +++-\n t/t2200-add-update.sh                  |    2 +-\n t/t2201-add-update-typechange.sh       |   16 ++++-\n t/t2300-cd-to-toplevel.sh              |   14 ++--\n t/t3000-ls-files-others.sh             |    7 ++-\n t/t3010-ls-files-killed-modified.sh    |   17 ++++-\n t/t3100-ls-tree-restrict.sh            |   40 +++++++----\n t/t3200-branch.sh                      |    2 +-\n t/t3600-rm.sh                          |   58 ++++++++--------\n t/t3700-add.sh                         |   16 ++--\n t/t3701-add-interactive.sh             |    9 ++-\n t/t4004-diff-rename-symlink.sh         |    7 ++\n t/t4008-diff-break-rewrite.sh          |    8 +-\n t/t4011-diff-symlink.sh                |    7 ++\n t/t4023-diff-rename-typechange.sh      |    7 ++\n t/t4102-apply-rename.sh                |    8 ++-\n t/t4114-apply-typechange.sh            |    7 ++\n t/t4115-apply-symlink.sh               |    7 ++\n t/t4122-apply-symlink-inside.sh        |    7 ++\n t/t4129-apply-samemode.sh              |   19 ++++--\n t/t5000-tar-tree.sh                    |   22 ++++---\n t/t5302-pack-index.sh                  |   15 ++---\n t/t5503-tagfollow.sh                   |    7 ++\n t/t5522-pull-symlink.sh                |    7 ++\n t/t6031-merge-recursive.sh             |   13 ++++\n t/t6200-fmt-merge-msg.sh               |    4 +-\n t/t7001-mv.sh                          |    4 +-\n t/t7004-tag.sh                         |   97 +++++++++++++-------------\n t/t7503-pre-commit-hook.sh             |    4 +-\n t/t7504-commit-msg-hook.sh             |    8 +-\n t/t9100-git-svn-basic.sh               |   37 +++++------\n t/t9129-git-svn-i18n-commitencoding.sh |   22 +++---\n t/t9131-git-svn-empty-symlink.sh       |    2 +-\n t/t9132-git-svn-broken-symlink.sh      |    4 +-\n t/t9200-git-cvsexportcommit.sh         |   13 ++--\n t/t9500-gitweb-standalone-no-errors.sh |   11 ++-\n t/test-lib.sh                          |   74 +++++++++++++++++++--\n 52 files changed, 594 insertions(+), 288 deletions(-)\n"},{"id":"108815","messageId":"f17e9fbbe919bc1f4ecaa35a9cb0869a5ec47fc0.1237667830.git.j6t@kdbg.org","threadId":"18451","inReplyTo":"cover.1237667830.git.j6t@kdbg.org","subject":"[PATCH 01/16] test-lib: Work around incompatible sort and find on Windows","fromName":"Johannes Sixt","fromEmail":"j6t@kdbg.org","sentAt":"2009-03-21T21:26:24Z","receivedAt":"2009-03-21T21:26:24Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"If the PATH lists the Windows system directories before the MSYS\ndirectories, Windows's own incompatible sort and find commands would be\npicked up. We implement these commands as functions and call the real\ntools by absolute path.\n\nSigned-off-by: Johannes Sixt <j6t@kdbg.org>\n---\n  BTW, we have the same thing in git-sh-setup.sh\n\n t/test-lib.sh |   13 +++++++++++++\n 1 files changed, 13 insertions(+), 0 deletions(-)\n\ndiff --git a/t/test-lib.sh b/t/test-lib.sh\nindex 638cca4..4eda5ab 100644\n--- a/t/test-lib.sh\n+++ b/t/test-lib.sh\n@@ -635,3 +635,16 @@ do\n \t\ttest_done\n \tesac\n done\n+\n+# Fix some commands on Windows\n+case $(uname -s) in\n+*MINGW*)\n+\t# Windows has its own (incompatible) sort and find\n+\tsort () {\n+\t\t/usr/bin/sort \"$@\"\n+\t}\n+\tfind () {\n+\t\t/usr/bin/find \"$@\"\n+\t}\n+\t;;\n+esac\n-- \n1.6.2.1.224.g2225f\n"},{"id":"108816","messageId":"5397ea314f612eaaacfb13d978319afd2c724817.1237667830.git.j6t@kdbg.org","threadId":"18451","inReplyTo":"cover.1237667830.git.j6t@kdbg.org","subject":"[PATCH 02/16] test-lib: Work around missing sum on Windows","fromName":"Johannes Sixt","fromEmail":"j6t@kdbg.org","sentAt":"2009-03-21T21:26:25Z","receivedAt":"2009-03-21T21:26:25Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"t1002-read-tree-m-u-2way.sh uses 'sum', but it does not rely on the exact\nform of the sum, only that it is a hash digest. Therefore, we can sneak\nin 'md5sum' under the name 'sum'.\n\nSigned-off-by: Johannes Sixt <j6t@kdbg.org>\n---\n t/test-lib.sh |    3 +++\n 1 files changed, 3 insertions(+), 0 deletions(-)\n\ndiff --git a/t/test-lib.sh b/t/test-lib.sh\nindex 4eda5ab..4720b9a 100644\n--- a/t/test-lib.sh\n+++ b/t/test-lib.sh\n@@ -646,5 +646,8 @@ case $(uname -s) in\n \tfind () {\n \t\t/usr/bin/find \"$@\"\n \t}\n+\tsum () {\n+\t\tmd5sum \"$@\"\n+\t}\n \t;;\n esac\n-- \n1.6.2.1.224.g2225f\n"},{"id":"108823","messageId":"4114156ae959a8ecfea62213df35fd8f778d9c4e.1237667830.git.j6t@kdbg.org","threadId":"18451","inReplyTo":"cover.1237667830.git.j6t@kdbg.org","subject":"[PATCH 03/16] Tests on Windows: $(pwd) must return Windows-style paths","fromName":"Johannes Sixt","fromEmail":"j6t@kdbg.org","sentAt":"2009-03-21T21:26:26Z","receivedAt":"2009-03-21T21:26:26Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Many tests pass $(pwd) in some form to git and later test that the output\nof git contains the correct value of $(pwd). For example, the test of\n'git remote show' sets up a remote that contains $(pwd) and then the\nexpected result must contain $(pwd).\n\nAgain, MSYS-bash's path mangling kicks in: Plain $(pwd) uses the MSYS style\nabsolute path /c/path/to/git. The test case would write this name into\nthe 'expect' file. But when git is invoked, MSYS-bash converts this name to\nthe Windows style path c:/path/to/git, and git would produce this form in\nthe result; the test would fail.\n\nWe fix this by passing -W to bash's pwd that produces the Windows-style\npath.\n\nThere are a two cases that need an accompanying change:\n\n- In t1504 the value of $(pwd) becomes part of a path list. In this case,\n  the lone 'c' in something like /foo:c:/path/to/git:/bar inhibits\n  MSYS-bashes path mangling; IOW in this case we want the /c/path/to/git\n  form to allow path mangling. We use $PWD instead of $(pwd), which always\n  has the latter form.\n\n- In t6200, $(pwd) - the Windows style path - must be used to construct the\n  expected result because that is the path form that git sees. (The change\n  in the test itself is just for consistency: 'git fetch' always sees the\n  Windows-style path, with or without the change.)\n\nSigned-off-by: Johannes Sixt <j6t@kdbg.org>\n---\n t/t1504-ceiling-dirs.sh  |    2 +-\n t/t6200-fmt-merge-msg.sh |    4 ++--\n t/test-lib.sh            |    4 ++++\n 3 files changed, 7 insertions(+), 3 deletions(-)\n\ndiff --git a/t/t1504-ceiling-dirs.sh b/t/t1504-ceiling-dirs.sh\nindex e377d48..df5ad8c 100755\n--- a/t/t1504-ceiling-dirs.sh\n+++ b/t/t1504-ceiling-dirs.sh\n@@ -13,7 +13,7 @@ test_fail() {\n \t\"git rev-parse --show-prefix\"\n }\n \n-TRASH_ROOT=\"$(pwd)\"\n+TRASH_ROOT=\"$PWD\"\n ROOT_PARENT=$(dirname \"$TRASH_ROOT\")\n \n \ndiff --git a/t/t6200-fmt-merge-msg.sh b/t/t6200-fmt-merge-msg.sh\nindex 8f5a06f..2049ab6 100755\n--- a/t/t6200-fmt-merge-msg.sh\n+++ b/t/t6200-fmt-merge-msg.sh\n@@ -83,13 +83,13 @@ test_expect_success 'merge-msg test #1' '\n '\n \n cat >expected <<EOF\n-Merge branch 'left' of $TEST_DIRECTORY/$test\n+Merge branch 'left' of $(pwd)\n EOF\n \n test_expect_success 'merge-msg test #2' '\n \n \tgit checkout master &&\n-\tgit fetch \"$TEST_DIRECTORY/$test\" left &&\n+\tgit fetch \"$(pwd)\" left &&\n \n \tgit fmt-merge-msg <.git/FETCH_HEAD >actual &&\n \ttest_cmp expected actual\ndiff --git a/t/test-lib.sh b/t/test-lib.sh\nindex 4720b9a..0a0696a 100644\n--- a/t/test-lib.sh\n+++ b/t/test-lib.sh\n@@ -649,5 +649,9 @@ case $(uname -s) in\n \tsum () {\n \t\tmd5sum \"$@\"\n \t}\n+\t# git sees Windows-style pwd\n+\tpwd () {\n+\t\tbuiltin pwd -W\n+\t}\n \t;;\n esac\n-- \n1.6.2.1.224.g2225f\n"},{"id":"108814","messageId":"64e61f2d173b0172d9dbaa9667486764224568fb.1237667830.git.j6t@kdbg.org","threadId":"18451","inReplyTo":"cover.1237667830.git.j6t@kdbg.org","subject":"[PATCH 04/16] t0050: Check whether git init detected symbolic link support correctly","fromName":"Johannes Sixt","fromEmail":"j6t@kdbg.org","sentAt":"2009-03-21T21:26:27Z","receivedAt":"2009-03-21T21:26:27Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Signed-off-by: Johannes Sixt <j6t@kdbg.org>\n---\n t/t0050-filesystem.sh |   28 ++++++++++++++++++++++++++--\n 1 files changed, 26 insertions(+), 2 deletions(-)\n\ndiff --git a/t/t0050-filesystem.sh b/t/t0050-filesystem.sh\nindex a449580..89282cc 100755\n--- a/t/t0050-filesystem.sh\n+++ b/t/t0050-filesystem.sh\n@@ -9,7 +9,8 @@ aumlcdiar=`printf '\\x61\\xcc\\x88'`\n \n case_insensitive=\n unibad=\n-test_expect_success 'see if we expect ' '\n+no_symlinks=\n+test_expect_success 'see what we expect' '\n \n \ttest_case=test_expect_success\n \ttest_unicode=test_expect_success\n@@ -31,13 +32,21 @@ test_expect_success 'see if we expect ' '\n \t\t;;\n \t*)\t;;\n \tesac &&\n-\trm -fr junk\n+\trm -fr junk &&\n+\t{\n+\t\tln -s x y 2> /dev/null &&\n+\t\ttest -h y 2> /dev/null ||\n+\t\tno_symlinks=1\n+\t\trm -f y\n+\t}\n '\n \n test \"$case_insensitive\" &&\n \tsay \"will test on a case insensitive filesystem\"\n test \"$unibad\" &&\n \tsay \"will test on a unicode corrupting filesystem\"\n+test \"$no_symlinks\" &&\n+\tsay \"will test on a filesystem lacking symbolic links\"\n \n if test \"$case_insensitive\"\n then\n@@ -53,6 +62,21 @@ test_expect_success \"detection of case insensitive filesystem during repo init\"\n '\n fi\n \n+if test \"$no_symlinks\"\n+then\n+test_expect_success \"detection of filesystem w/o symlink support during repo init\" '\n+\n+\tv=$(git config --bool core.symlinks) &&\n+\ttest \"$v\" = false\n+'\n+else\n+test_expect_success \"detection of filesystem w/o symlink support during repo init\" '\n+\n+\ttest_must_fail git config --bool core.symlinks ||\n+\ttest \"$(git config --bool core.symlinks)\" = true\n+'\n+fi\n+\n test_expect_success \"setup case tests\" '\n \n \tgit config core.ignorecase true &&\n-- \n1.6.2.1.224.g2225f\n"},{"id":"108825","messageId":"a7bb394037e1c32d47d0b04da025bdbe2eb78d66.1237667830.git.j6t@kdbg.org","threadId":"18451","inReplyTo":"cover.1237667830.git.j6t@kdbg.org","subject":"[PATCH 05/16] test-lib: Infrastructure to test and check for prerequisites","fromName":"Johannes Sixt","fromEmail":"j6t@kdbg.org","sentAt":"2009-03-21T21:26:28Z","receivedAt":"2009-03-21T21:26:28Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Some tests can be run only if a particular prerequisite is available. For\nexample, some tests require that an UTF-8 locale is available. Here we\nintroduce functions that are used in this way:\n\n1. Insert code that checks whether the prerequisite is available. If it is,\n   call test_set_prereq with an arbitrary tag name that subsequently can be\n   used to check for the prerequisite:\n\n      case $LANG in\n      *.utf-8)\n            test_set_prereq UTF8\n            ;;\n      esac\n\n2. In the calls to test_expect_success pass the tag name:\n\n      test_expect_success UTF8 '...description...' '...tests...'\n\n3. There is an auxiliary predicate that can be used anywhere to test for\n   a prerequisite explicitly:\n\n      if test_have_prereq UTF8\n      then\n            ...code to be skipped if prerequisite is not available...\n      fi\n\nSigned-off-by: Johannes Sixt <j6t@kdbg.org>\n---\n t/t0000-basic.sh |   15 +++++++++++++++\n t/test-lib.sh    |   44 +++++++++++++++++++++++++++++++++++++++-----\n 2 files changed, 54 insertions(+), 5 deletions(-)\n\ndiff --git a/t/t0000-basic.sh b/t/t0000-basic.sh\nindex ddcd5b0..c53de1f 100755\n--- a/t/t0000-basic.sh\n+++ b/t/t0000-basic.sh\n@@ -57,6 +57,21 @@ test_expect_failure 'pretend we have a known breakage' '\n test_expect_failure 'pretend we have fixed a known breakage' '\n     :\n '\n+test_set_prereq HAVEIT\n+haveit=no\n+test_expect_success HAVEIT 'test runs if prerequisite is satisfied' '\n+    test_have_prereq HAVEIT &&\n+    haveit=yes\n+'\n+donthaveit=yes\n+test_expect_success DONTHAVEIT 'unmet prerequisite causes test to be skipped' '\n+    donthaveit=no\n+'\n+if test $haveit$donthaveit != yesyes\n+then\n+\tsay \"bug in test framework: prerequisite tags do not work reliably\"\n+\texit 1\n+fi\n \n ################################################################\n # Basics of the basics\ndiff --git a/t/test-lib.sh b/t/test-lib.sh\nindex 0a0696a..3c65cfe 100644\n--- a/t/test-lib.sh\n+++ b/t/test-lib.sh\n@@ -247,6 +247,31 @@ test_chmod () {\n \tgit update-index --add \"--chmod=$@\"\n }\n \n+# Use test_set_prereq to tell that a particular prerequisite is available.\n+# The prerequisite can later be checked for in two ways:\n+#\n+# - Explicitly using test_have_prereq.\n+#\n+# - Implicitly by specifying the prerequisite tag in the calls to\n+#   test_expect_{success,failure,code}.\n+#\n+# The single parameter is the prerequisite tag (a simple word, in all\n+# capital letters by convention).\n+\n+test_set_prereq () {\n+\tsatisfied=\"$satisfied$1 \"\n+}\n+satisfied=\" \"\n+\n+test_have_prereq () {\n+\tcase $satisfied in\n+\t*\" $1 \"*)\n+\t\t: yes, have it ;;\n+\t*)\n+\t\t! : nope ;;\n+\tesac\n+}\n+\n # You are not expected to call test_ok_ and test_failure_ directly, use\n # the text_expect_* functions instead.\n \n@@ -293,6 +318,11 @@ test_skip () {\n \t\t\tto_skip=t\n \t\tesac\n \tdone\n+\tif test -z \"$to_skip\" && test -n \"$prereq\" &&\n+\t   ! test_have_prereq \"$prereq\"\n+\tthen\n+\t\tto_skip=t\n+\tfi\n \tcase \"$to_skip\" in\n \tt)\n \t\tsay_color skip >&3 \"skipping test: $@\"\n@@ -306,8 +336,9 @@ test_skip () {\n }\n \n test_expect_failure () {\n+\ttest \"$#\" = 3 && { prereq=$1; shift; } || prereq=\n \ttest \"$#\" = 2 ||\n-\terror \"bug in the test script: not 2 parameters to test-expect-failure\"\n+\terror \"bug in the test script: not 2 or 3 parameters to test-expect-failure\"\n \tif ! test_skip \"$@\"\n \tthen\n \t\tsay >&3 \"checking known breakage: $2\"\n@@ -323,8 +354,9 @@ test_expect_failure () {\n }\n \n test_expect_success () {\n+\ttest \"$#\" = 3 && { prereq=$1; shift; } || prereq=\n \ttest \"$#\" = 2 ||\n-\terror \"bug in the test script: not 2 parameters to test-expect-success\"\n+\terror \"bug in the test script: not 2 or 3 parameters to test-expect-success\"\n \tif ! test_skip \"$@\"\n \tthen\n \t\tsay >&3 \"expecting success: $2\"\n@@ -340,8 +372,9 @@ test_expect_success () {\n }\n \n test_expect_code () {\n+\ttest \"$#\" = 4 && { prereq=$1; shift; } || prereq=\n \ttest \"$#\" = 3 ||\n-\terror \"bug in the test script: not 3 parameters to test-expect-code\"\n+\terror \"bug in the test script: not 3 or 4 parameters to test-expect-code\"\n \tif ! test_skip \"$@\"\n \tthen\n \t\tsay >&3 \"expecting exit code $1: $3\"\n@@ -365,8 +398,9 @@ test_expect_code () {\n # Usage: test_external description command arguments...\n # Example: test_external 'Perl API' perl ../path/to/test.pl\n test_external () {\n-\ttest \"$#\" -eq 3 ||\n-\terror >&5 \"bug in the test script: not 3 parameters to test_external\"\n+\ttest \"$#\" = 4 && { prereq=$1; shift; } || prereq=\n+\ttest \"$#\" = 3 ||\n+\terror >&5 \"bug in the test script: not 3 or 4 parameters to test_external\"\n \tdescr=\"$1\"\n \tshift\n \tif ! test_skip \"$descr\" \"$@\"\n-- \n1.6.2.1.224.g2225f\n"},{"id":"108817","messageId":"70f789fecee6955c362391b33272223c7ba74cc6.1237667830.git.j6t@kdbg.org","threadId":"18451","inReplyTo":"cover.1237667830.git.j6t@kdbg.org","subject":"[PATCH 06/16] t3600: Use test prerequisite tags","fromName":"Johannes Sixt","fromEmail":"j6t@kdbg.org","sentAt":"2009-03-21T21:26:29Z","receivedAt":"2009-03-21T21:26:29Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"The are two prerequisites.\n\n- The filesystem support names with tabs or new-lines.\n\n- Files cannot be removed if their containing directory is read-only.\n\nPreviously, whether these preconditions are satisified was tested inside\ntest_expect_success. We move these tests outside because, strictly\nspeaking, they are not part of the tests.\n\nSigned-off-by: Johannes Sixt <j6t@kdbg.org>\n---\n t/t3600-rm.sh |   58 +++++++++++++++++++++++++++++---------------------------\n 1 files changed, 30 insertions(+), 28 deletions(-)\n\ndiff --git a/t/t3600-rm.sh b/t/t3600-rm.sh\nindex 2aefbcf..76b1bb4 100755\n--- a/t/t3600-rm.sh\n+++ b/t/t3600-rm.sh\n@@ -12,31 +12,37 @@ test_expect_success \\\n     'Initialize test directory' \\\n     \"touch -- foo bar baz 'space embedded' -q &&\n      git add -- foo bar baz 'space embedded' -q &&\n-     git commit -m 'add normal files' &&\n-     test_tabs=y &&\n-     if touch -- 'tab\tembedded' 'newline\n-embedded'\n-     then\n+     git commit -m 'add normal files'\"\n+\n+if touch -- 'tab\tembedded' 'newline\n+embedded' 2>/dev/null\n+then\n+\ttest_set_prereq FUNNYNAMES\n+else\n+\tsay 'Your filesystem does not allow tabs in filenames.'\n+fi\n+\n+test_expect_success FUNNYNAMES 'add files with funny names' \"\n      git add -- 'tab\tembedded' 'newline\n embedded' &&\n      git commit -m 'add files with tabs and newlines'\n-     else\n-         test_tabs=n\n-     fi\"\n-\n-test \"$test_tabs\" = n && say 'Your filesystem does not allow tabs in filenames.'\n+\"\n \n+# Determine rm behavior\n # Later we will try removing an unremovable path to make sure\n # git rm barfs, but if the test is run as root that cannot be\n # arranged.\n-test_expect_success \\\n-    'Determine rm behavior' \\\n-    ': >test-file\n-     chmod a-w .\n-     rm -f test-file\n-     test -f test-file && test_failed_remove=y\n-     chmod 775 .\n-     rm -f test-file'\n+: >test-file\n+chmod a-w .\n+rm -f test-file 2>/dev/null\n+if test -f test-file\n+then\n+\ttest_set_prereq RO_DIR\n+else\n+\tsay 'skipping removal failure test (perhaps running as root?)'\n+fi\n+chmod 775 .\n+rm -f test-file\n \n test_expect_success \\\n     'Pre-check that foo exists and is in index before git rm foo' \\\n@@ -101,20 +107,16 @@ test_expect_success \\\n     'Test that \"git rm -- -q\" succeeds (remove a file that looks like an option)' \\\n     'git rm -- -q'\n \n-test \"$test_tabs\" = y && test_expect_success \\\n+test_expect_success FUNNYNAMES \\\n     \"Test that \\\"git rm -f\\\" succeeds with embedded space, tab, or newline characters.\" \\\n     \"git rm -f 'space embedded' 'tab\tembedded' 'newline\n embedded'\"\n \n-if test \"$test_failed_remove\" = y; then\n-chmod a-w .\n-test_expect_success \\\n-    'Test that \"git rm -f\" fails if its rm fails' \\\n-    'test_must_fail git rm -f baz'\n-chmod 775 .\n-else\n-    say 'skipping removal failure test (perhaps running as root?)'\n-fi\n+test_expect_success RO_DIR 'Test that \"git rm -f\" fails if its rm fails' '\n+\tchmod a-w . &&\n+\ttest_must_fail git rm -f baz &&\n+\tchmod 775 .\n+'\n \n test_expect_success \\\n     'When the rm in \"git rm -f\" fails, it should not remove the file from the index' \\\n-- \n1.6.2.1.224.g2225f\n"},{"id":"108821","messageId":"4cc90ded4ca612650968d84233cf84993d4359a2.1237667830.git.j6t@kdbg.org","threadId":"18451","inReplyTo":"cover.1237667830.git.j6t@kdbg.org","subject":"[PATCH 07/16] Skip tests that fail if the executable bit is not handled by the filesystem","fromName":"Johannes Sixt","fromEmail":"j6t@kdbg.org","sentAt":"2009-03-21T21:26:30Z","receivedAt":"2009-03-21T21:26:30Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Signed-off-by: Johannes Sixt <j6t@kdbg.org>\n---\n t/t3701-add-interactive.sh     |    9 +++++----\n t/t4102-apply-rename.sh        |    8 +++++---\n t/t4129-apply-samemode.sh      |   19 +++++++++++++------\n t/t6031-merge-recursive.sh     |   13 +++++++++++++\n t/t9200-git-cvsexportcommit.sh |   13 ++++++-------\n 5 files changed, 42 insertions(+), 20 deletions(-)\n\ndiff --git a/t/t3701-add-interactive.sh b/t/t3701-add-interactive.sh\nindex e95663d..fe01783 100755\n--- a/t/t3701-add-interactive.sh\n+++ b/t/t3701-add-interactive.sh\n@@ -135,10 +135,12 @@ test_expect_success 'real edit works' '\n \n if test \"$(git config --bool core.filemode)\" = false\n then\n-    say 'skipping filemode tests (filesystem does not properly support modes)'\n+\tsay 'skipping filemode tests (filesystem does not properly support modes)'\n else\n+\ttest_set_prereq FILEMODE\n+fi\n \n-test_expect_success 'patch does not affect mode' '\n+test_expect_success FILEMODE 'patch does not affect mode' '\n \tgit reset --hard &&\n \techo content >>file &&\n \tchmod +x file &&\n@@ -147,7 +149,7 @@ test_expect_success 'patch does not affect mode' '\n \tgit diff file | grep \"new mode\"\n '\n \n-test_expect_success 'stage mode but not hunk' '\n+test_expect_success FILEMODE 'stage mode but not hunk' '\n \tgit reset --hard &&\n \techo content >>file &&\n \tchmod +x file &&\n@@ -156,7 +158,6 @@ test_expect_success 'stage mode but not hunk' '\n \tgit diff          file | grep \"+content\"\n '\n \n-fi\n # end of tests disabled when filemode is not usable\n \n test_done\ndiff --git a/t/t4102-apply-rename.sh b/t/t4102-apply-rename.sh\nindex d42abff..1597965 100755\n--- a/t/t4102-apply-rename.sh\n+++ b/t/t4102-apply-rename.sh\n@@ -31,14 +31,16 @@ test_expect_success setup \\\n test_expect_success apply \\\n     'git apply --index --stat --summary --apply test-patch'\n \n-if [ \"$(git config --get core.filemode)\" = false ]\n+if test \"$(git config --bool core.filemode)\" = false\n then\n \tsay 'filemode disabled on the filesystem'\n else\n-\ttest_expect_success validate \\\n-\t    'test -f bar && ls -l bar | grep \"^-..x......\"'\n+\ttest_set_prereq FILEMODE\n fi\n \n+test_expect_success FILEMODE validate \\\n+\t    'test -f bar && ls -l bar | grep \"^-..x......\"'\n+\n test_expect_success 'apply reverse' \\\n     'git apply -R --index --stat --summary --apply test-patch &&\n      test \"$(cat foo)\" = \"This is foo\"'\ndiff --git a/t/t4129-apply-samemode.sh b/t/t4129-apply-samemode.sh\nindex adfcbb5..fc7af04 100755\n--- a/t/t4129-apply-samemode.sh\n+++ b/t/t4129-apply-samemode.sh\n@@ -4,6 +4,13 @@ test_description='applying patch with mode bits'\n \n . ./test-lib.sh\n \n+if test \"$(git config --bool core.filemode)\" = false\n+then\n+\tsay 'filemode disabled on the filesystem'\n+else\n+\ttest_set_prereq FILEMODE\n+fi\n+\n test_expect_success setup '\n \techo original >file &&\n \tgit add file &&\n@@ -16,14 +23,14 @@ test_expect_success setup '\n \tgit diff --stat -p >patch-1.txt\n '\n \n-test_expect_success 'same mode (no index)' '\n+test_expect_success FILEMODE 'same mode (no index)' '\n \tgit reset --hard &&\n \tchmod +x file &&\n \tgit apply patch-0.txt &&\n \ttest -x file\n '\n \n-test_expect_success 'same mode (with index)' '\n+test_expect_success FILEMODE 'same mode (with index)' '\n \tgit reset --hard &&\n \tchmod +x file &&\n \tgit add file &&\n@@ -32,7 +39,7 @@ test_expect_success 'same mode (with index)' '\n \tgit diff --exit-code\n '\n \n-test_expect_success 'same mode (index only)' '\n+test_expect_success FILEMODE 'same mode (index only)' '\n \tgit reset --hard &&\n \tchmod +x file &&\n \tgit add file &&\n@@ -40,20 +47,20 @@ test_expect_success 'same mode (index only)' '\n \tgit ls-files -s file | grep \"^100755\"\n '\n \n-test_expect_success 'mode update (no index)' '\n+test_expect_success FILEMODE 'mode update (no index)' '\n \tgit reset --hard &&\n \tgit apply patch-1.txt &&\n \ttest -x file\n '\n \n-test_expect_success 'mode update (with index)' '\n+test_expect_success FILEMODE 'mode update (with index)' '\n \tgit reset --hard &&\n \tgit apply --index patch-1.txt &&\n \ttest -x file &&\n \tgit diff --exit-code\n '\n \n-test_expect_success 'mode update (index only)' '\n+test_expect_success FILEMODE 'mode update (index only)' '\n \tgit reset --hard &&\n \tgit apply --cached patch-1.txt &&\n \tgit ls-files -s file | grep \"^100755\"\ndiff --git a/t/t6031-merge-recursive.sh b/t/t6031-merge-recursive.sh\nindex 41c6860..8a3304f 100755\n--- a/t/t6031-merge-recursive.sh\n+++ b/t/t6031-merge-recursive.sh\n@@ -3,6 +3,11 @@\n test_description='merge-recursive: handle file mode'\n . ./test-lib.sh\n \n+if ! test \"$(git config --bool core.filemode)\" = false\n+then\n+\ttest_set_prereq FILEMODE\n+fi\n+\n test_expect_success 'mode change in one branch: keep changed version' '\n \t: >file1 &&\n \tgit add file1 &&\n@@ -16,6 +21,10 @@ test_expect_success 'mode change in one branch: keep changed version' '\n \tgit commit -m b1 &&\n \tgit checkout a1 &&\n \tgit merge-recursive master -- a1 b1 &&\n+\tgit ls-files -s file1 | grep ^100755\n+'\n+\n+test_expect_success FILEMODE 'verify executable bit on file' '\n \ttest -x file1\n '\n \n@@ -41,6 +50,10 @@ test_expect_success 'mode change in both branches: expect conflict' '\n \t\techo \"100644 $H 3\tfile2\"\n \t) >expect &&\n \ttest_cmp actual expect &&\n+\tgit ls-files -s file2 | grep ^100755\n+'\n+\n+test_expect_success FILEMODE 'verify executable bit on file' '\n \ttest -x file2\n '\n \ndiff --git a/t/t9200-git-cvsexportcommit.sh b/t/t9200-git-cvsexportcommit.sh\nindex d28b71b..995f607 100755\n--- a/t/t9200-git-cvsexportcommit.sh\n+++ b/t/t9200-git-cvsexportcommit.sh\n@@ -225,11 +225,12 @@ test_expect_success \\\n       test_must_fail git cvsexportcommit -c $id\n       )'\n \n-case \"$(git config --bool core.filemode)\" in\n-false)\n-\t;;\n-*)\n-test_expect_success \\\n+if ! test \"$(git config --bool core.filemode)\" = false\n+then\n+\ttest_set_prereq FILEMODE\n+fi\n+\n+test_expect_success FILEMODE \\\n      'Retain execute bit' \\\n      'mkdir G &&\n       echo executeon >G/on &&\n@@ -243,8 +244,6 @@ test_expect_success \\\n       test -x G/on &&\n       ! test -x G/off\n       )'\n-\t;;\n-esac\n \n test_expect_success '-w option should work with relative GIT_DIR' '\n       mkdir W &&\n-- \n1.6.2.1.224.g2225f\n"},{"id":"108818","messageId":"8b7aae1a054a86ae7984386bc8e061a408534873.1237667830.git.j6t@kdbg.org","threadId":"18451","inReplyTo":"cover.1237667830.git.j6t@kdbg.org","subject":"[PATCH 08/16] t5302: Use prerequisite tags to skip 64-bit offset tests","fromName":"Johannes Sixt","fromEmail":"j6t@kdbg.org","sentAt":"2009-03-21T21:26:31Z","receivedAt":"2009-03-21T21:26:31Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"The effects of this patch can be tested on Linux by commenting out\n\n  #define _FILE_OFFSET_BITS 64\n\nin git-compat-util.h.\n\nSigned-off-by: Johannes Sixt <j6t@kdbg.org>\n---\n t/t5302-pack-index.sh |   15 +++++----------\n 1 files changed, 5 insertions(+), 10 deletions(-)\n\ndiff --git a/t/t5302-pack-index.sh b/t/t5302-pack-index.sh\nindex 77982cd..4360e77 100755\n--- a/t/t5302-pack-index.sh\n+++ b/t/t5302-pack-index.sh\n@@ -69,32 +69,27 @@ test_expect_success \\\n     'index v2: force some 64-bit offsets with pack-objects' \\\n     'pack3=$(git pack-objects --index-version=2,0x40000 test-3 <obj-list)'\n \n-have_64bits=\n if msg=$(git verify-pack -v \"test-3-${pack3}.pack\" 2>&1) ||\n \t! (echo \"$msg\" | grep \"pack too large .* off_t\")\n then\n-\thave_64bits=t\n+\ttest_set_prereq OFF64_T\n else\n \tsay \"skipping tests concerning 64-bit offsets\"\n fi\n \n-test \"$have_64bits\" &&\n-test_expect_success \\\n+test_expect_success OFF64_T \\\n     'index v2: verify a pack with some 64-bit offsets' \\\n     'git verify-pack -v \"test-3-${pack3}.pack\"'\n \n-test \"$have_64bits\" &&\n-test_expect_success \\\n+test_expect_success OFF64_T \\\n     '64-bit offsets: should be different from previous index v2 results' \\\n     '! cmp \"test-2-${pack2}.idx\" \"test-3-${pack3}.idx\"'\n \n-test \"$have_64bits\" &&\n-test_expect_success \\\n+test_expect_success OFF64_T \\\n     'index v2: force some 64-bit offsets with index-pack' \\\n     'git index-pack --index-version=2,0x40000 -o 3.idx \"test-1-${pack1}.pack\"'\n \n-test \"$have_64bits\" &&\n-test_expect_success \\\n+test_expect_success OFF64_T \\\n     '64-bit offsets: index-pack result should match pack-objects one' \\\n     'cmp \"test-3-${pack3}.idx\" \"3.idx\"'\n \n-- \n1.6.2.1.224.g2225f\n"},{"id":"108824","messageId":"ed170175a2efbe8ff7043d58cf5f7fd275cf9986.1237667830.git.j6t@kdbg.org","threadId":"18451","inReplyTo":"cover.1237667830.git.j6t@kdbg.org","subject":"[PATCH 09/16] t9100, t9129: Use prerequisite tags for UTF-8 tests","fromName":"Johannes Sixt","fromEmail":"j6t@kdbg.org","sentAt":"2009-03-21T21:26:32Z","receivedAt":"2009-03-21T21:26:32Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Signed-off-by: Johannes Sixt <j6t@kdbg.org>\n---\n t/t9100-git-svn-basic.sh               |   37 +++++++++++++------------------\n t/t9129-git-svn-i18n-commitencoding.sh |   22 ++++++++++--------\n 2 files changed, 28 insertions(+), 31 deletions(-)\n\ndiff --git a/t/t9100-git-svn-basic.sh b/t/t9100-git-svn-basic.sh\nindex bb921af..4eee2e9 100755\n--- a/t/t9100-git-svn-basic.sh\n+++ b/t/t9100-git-svn-basic.sh\n@@ -6,19 +6,19 @@\n test_description='git svn basic tests'\n GIT_SVN_LC_ALL=${LC_ALL:-$LANG}\n \n+. ./lib-git-svn.sh\n+\n+say 'define NO_SVN_TESTS to skip git svn tests'\n+\n case \"$GIT_SVN_LC_ALL\" in\n *.UTF-8)\n-\thave_utf8=t\n+\ttest_set_prereq UTF8\n \t;;\n *)\n-\thave_utf8=\n+\tsay \"UTF-8 locale not set, some tests skipped ($GIT_SVN_LC_ALL)\"\n \t;;\n esac\n \n-. ./lib-git-svn.sh\n-\n-say 'define NO_SVN_TESTS to skip git svn tests'\n-\n test_expect_success \\\n     'initialize git svn' '\n \tmkdir import &&\n@@ -171,20 +171,15 @@ test_expect_success \"$name\" '\n \ttest ! -L \"$SVN_TREE\"/exec-2.sh &&\n \ttest_cmp help \"$SVN_TREE\"/exec-2.sh'\n \n-if test \"$have_utf8\" = t\n-then\n-\tname=\"commit with UTF-8 message: locale: $GIT_SVN_LC_ALL\"\n-\tLC_ALL=\"$GIT_SVN_LC_ALL\"\n-\texport LC_ALL\n-\ttest_expect_success \"$name\" \"\n-\t\techo '# hello' >> exec-2.sh &&\n-\t\tgit update-index exec-2.sh &&\n-\t\tgit commit -m 'Ã©Ã¯â' &&\n-\t\tgit svn set-tree HEAD\"\n-\tunset LC_ALL\n-else\n-\tsay \"UTF-8 locale not set, test skipped ($GIT_SVN_LC_ALL)\"\n-fi\n+name=\"commit with UTF-8 message: locale: $GIT_SVN_LC_ALL\"\n+LC_ALL=\"$GIT_SVN_LC_ALL\"\n+export LC_ALL\n+test_expect_success UTF8 \"$name\" \"\n+\techo '# hello' >> exec-2.sh &&\n+\tgit update-index exec-2.sh &&\n+\tgit commit -m 'Ã©Ã¯â' &&\n+\tgit svn set-tree HEAD\"\n+unset LC_ALL\n \n name='test fetch functionality (svn => git) with alternate GIT_SVN_ID'\n GIT_SVN_ID=alt\n@@ -197,7 +192,7 @@ test_expect_success \"$name\" \\\n \n name='check imported tree checksums expected tree checksums'\n rm -f expected\n-if test \"$have_utf8\" = t\n+if test_have_prereq UTF8\n then\n \techo tree bf522353586b1b883488f2bc73dab0d9f774b9a9 > expected\n fi\ndiff --git a/t/t9129-git-svn-i18n-commitencoding.sh b/t/t9129-git-svn-i18n-commitencoding.sh\nindex 9c7b1ad..3200ab3 100755\n--- a/t/t9129-git-svn-i18n-commitencoding.sh\n+++ b/t/t9129-git-svn-i18n-commitencoding.sh\n@@ -70,24 +70,26 @@ do\n done\n \n if locale -a |grep -q en_US.utf8; then\n-\ttest_expect_success 'ISO-8859-1 should match UTF-8 in svn' '\n+\ttest_set_prereq UTF8\n+else\n+\tsay \"UTF-8 locale not available, test skipped\"\n+fi\n+\n+test_expect_success UTF8 'ISO-8859-1 should match UTF-8 in svn' '\n \t(\n \t\tcd ISO-8859-1 &&\n \t\tcompare_svn_head_with \"$TEST_DIRECTORY\"/t3900/1-UTF-8.txt\n \t)\n-\t'\n+'\n \n-\tfor H in EUCJP ISO-2022-JP\n-\tdo\n-\t\ttest_expect_success '$H should match UTF-8 in svn' '\n+for H in EUCJP ISO-2022-JP\n+do\n+\ttest_expect_success UTF8 \"$H should match UTF-8 in svn\" '\n \t\t(\n \t\t\tcd $H &&\n \t\t\tcompare_svn_head_with \"$TEST_DIRECTORY\"/t3900/2-UTF-8.txt\n \t\t)\n-\t\t'\n-\tdone\n-else\n-\tsay \"UTF-8 locale not available, test skipped\"\n-fi\n+\t'\n+done\n \n test_done\n-- \n1.6.2.1.224.g2225f\n"},{"id":"108829","messageId":"a79bfc08b7d2d08498ff48223ddd51e3cefa37e5.1237667830.git.j6t@kdbg.org","threadId":"18451","inReplyTo":"cover.1237667830.git.j6t@kdbg.org","subject":"[PATCH 10/16] Use prerequisite tags to skip tests that depend on symbolic links","fromName":"Johannes Sixt","fromEmail":"j6t@kdbg.org","sentAt":"2009-03-21T21:26:33Z","receivedAt":"2009-03-21T21:26:33Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Many tests depend on that symbolic links work.  This introduces a check\nthat sets the prerequisite tag SYMLINKS if the file system supports\nsymbolic links.  Since so many tests have to check for this prerequisite,\nwe do the check in test-lib.sh, so that we don't need to repeat the test\nin many scripts.\n\nTo check for 'ln -s' failures, you can use a FAT partition on Linux:\n\n$ mkdosfs -C git-on-fat 1000000\n$ sudo mount -o loop,uid=j6t,gid=users,shortname=winnt git-on-fat /mnt\n\nClone git to /mnt and\n\n$ GIT_SKIP_TESTS='t0001.1[34] t0010 t1301 t403[34] t4129.[47] t5701.7\n          t7701.3 t9100 t9101.26 t9119 t9124.[67] t9200.10 t9600.6' \\\n        make test\n\n(These additionally skipped tests depend on POSIX permissions that FAT on\nLinux does not provide.)\n\nSigned-off-by: Johannes Sixt <j6t@kdbg.org>\n---\n t/t0000-basic.sh                       |   43 +++++++++++++++++++++++---------\n t/t0055-beyond-symlinks.sh             |    6 ++--\n t/t1004-read-tree-m-u-wf.sh            |    6 ++--\n t/t1020-subdirectory.sh                |    2 +-\n t/t1300-repo-config.sh                 |    2 +-\n t/t2001-checkout-cache-clash.sh        |    6 ++--\n t/t2003-checkout-cache-mkdir.sh        |    8 +++---\n t/t2004-checkout-cache-temp.sh         |    2 +-\n t/t2007-checkout-symlink.sh            |    6 ++++\n t/t2100-update-cache-badpath.sh        |   14 +++++++++-\n t/t2200-add-update.sh                  |    2 +-\n t/t2201-add-update-typechange.sh       |   16 +++++++++--\n t/t2300-cd-to-toplevel.sh              |   14 +++++-----\n t/t3000-ls-files-others.sh             |    7 ++++-\n t/t3010-ls-files-killed-modified.sh    |   17 ++++++++++--\n t/t3100-ls-tree-restrict.sh            |   40 +++++++++++++++++++----------\n t/t3200-branch.sh                      |    2 +-\n t/t3700-add.sh                         |    6 ++--\n t/t4004-diff-rename-symlink.sh         |    7 +++++\n t/t4008-diff-break-rewrite.sh          |    8 +++---\n t/t4011-diff-symlink.sh                |    7 +++++\n t/t4023-diff-rename-typechange.sh      |    7 +++++\n t/t4114-apply-typechange.sh            |    7 +++++\n t/t4115-apply-symlink.sh               |    7 +++++\n t/t4122-apply-symlink-inside.sh        |    7 +++++\n t/t5000-tar-tree.sh                    |    6 +++-\n t/t5522-pull-symlink.sh                |    7 +++++\n t/t7001-mv.sh                          |    4 +-\n t/t9131-git-svn-empty-symlink.sh       |    2 +-\n t/t9132-git-svn-broken-symlink.sh      |    4 +-\n t/t9500-gitweb-standalone-no-errors.sh |   11 ++++++--\n t/test-lib.sh                          |    4 +++\n 32 files changed, 211 insertions(+), 76 deletions(-)\n\ndiff --git a/t/t0000-basic.sh b/t/t0000-basic.sh\nindex c53de1f..f4ca4fc 100755\n--- a/t/t0000-basic.sh\n+++ b/t/t0000-basic.sh\n@@ -115,12 +115,31 @@ test_expect_success \\\n     'test \"$tree\" = 4b825dc642cb6eb9a060e54bf8d69288fbee4904'\n \n # Various types of objects\n+# Some filesystems do not support symblic links; on such systems\n+# some expected values are different\n mkdir path2 path3 path3/subp3\n-for p in path0 path2/file2 path3/file3 path3/subp3/file3\n+paths='path0 path2/file2 path3/file3 path3/subp3/file3'\n+for p in $paths\n do\n     echo \"hello $p\" >$p\n-    ln -s \"hello $p\" ${p}sym\n done\n+if test_have_prereq SYMLINKS\n+then\n+\tfor p in $paths\n+\tdo\n+\t\tln -s \"hello $p\" ${p}sym\n+\tdone\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 test_expect_success \\\n     'adding various types of objects with git update-index --add.' \\\n     'find path* ! -type d -print | xargs git update-index --add'\n@@ -130,7 +149,7 @@ test_expect_success \\\n     'showing stage with git ls-files --stage' \\\n     'git ls-files --stage >current'\n \n-cat >expected <<\\EOF\n+$expectfilter >expected <<\\EOF\n 100644 f87290f8eb2cbbea7857214459a0739927eab154 0\tpath0\n 120000 15a98433ae33114b085f3eb3bb03b832b3180a01 0\tpath0sym\n 100644 3feff949ed00a62d9f7af97c15cd8a30595e7ac7 0\tpath2/file2\n@@ -149,7 +168,7 @@ test_expect_success \\\n     'tree=$(git write-tree)'\n test_expect_success \\\n     'validate object ID for a known tree.' \\\n-    'test \"$tree\" = 087704a96baf1c2d1c869a8b084481e121c88b5b'\n+    'test \"$tree\" = \"$expectedtree\"'\n \n test_expect_success \\\n     'showing tree with git ls-tree' \\\n@@ -160,7 +179,7 @@ cat >expected <<\\EOF\n 040000 tree 58a09c23e2ca152193f2786e06986b7b6712bdbe\tpath2\n 040000 tree 21ae8269cacbe57ae09138dcc3a2887f904d02b3\tpath3\n EOF\n-test_expect_success \\\n+test_expect_success SYMLINKS \\\n     'git ls-tree output for a known tree.' \\\n     'test_cmp expected current'\n \n@@ -169,7 +188,7 @@ test_expect_success \\\n test_expect_success \\\n     'showing tree with git ls-tree -r' \\\n     'git ls-tree -r $tree >current'\n-cat >expected <<\\EOF\n+$expectfilter >expected <<\\EOF\n 100644 blob f87290f8eb2cbbea7857214459a0739927eab154\tpath0\n 120000 blob 15a98433ae33114b085f3eb3bb03b832b3180a01\tpath0sym\n 100644 blob 3feff949ed00a62d9f7af97c15cd8a30595e7ac7\tpath2/file2\n@@ -200,7 +219,7 @@ cat >expected <<\\EOF\n 100644 blob 00fb5908cb97c2564a9783c0c64087333b3b464f\tpath3/subp3/file3\n 120000 blob 6649a1ebe9e9f1c553b66f5a6e74136a07ccc57c\tpath3/subp3/file3sym\n EOF\n-test_expect_success \\\n+test_expect_success SYMLINKS \\\n     'git ls-tree -r output for a known tree.' \\\n     'test_cmp expected current'\n \n@@ -209,14 +228,14 @@ test_expect_success \\\n     'ptree=$(git write-tree --prefix=path3)'\n test_expect_success \\\n     'validate object ID for a known tree.' \\\n-    'test \"$ptree\" = 21ae8269cacbe57ae09138dcc3a2887f904d02b3'\n+    'test \"$ptree\" = \"$expectedptree1\"'\n \n test_expect_success \\\n     'writing partial tree out with git write-tree --prefix.' \\\n     'ptree=$(git write-tree --prefix=path3/subp3)'\n test_expect_success \\\n     'validate object ID for a known tree.' \\\n-    'test \"$ptree\" = 3c5e5399f3a333eddecce7a9b9465b63f65f51e2'\n+    'test \"$ptree\" = \"$expectedptree2\"'\n \n cat >badobjects <<EOF\n 100644 blob 1000000000000000000000000000000000000000\tdir/file1\n@@ -249,7 +268,7 @@ test_expect_success \\\n      newtree=$(git write-tree) &&\n      test \"$newtree\" = \"$tree\"'\n \n-cat >expected <<\\EOF\n+$expectfilter >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@@ -272,7 +291,7 @@ test_expect_success \\\n     'git diff-files >current && cmp -s current /dev/null'\n \n ################################################################\n-P=087704a96baf1c2d1c869a8b084481e121c88b5b\n+P=$expectedtree\n test_expect_success \\\n     'git commit-tree records the correct tree in a commit.' \\\n     'commit0=$(echo NO | git commit-tree $P) &&\n@@ -308,7 +327,7 @@ test_expect_success 'update-index D/F conflict' '\n \ttest $numpath0 = 1\n '\n \n-test_expect_success 'absolute path works as expected' '\n+test_expect_success SYMLINKS 'absolute path works as expected' '\n \tmkdir first &&\n \tln -s ../.git first/.git &&\n \tmkdir second &&\ndiff --git a/t/t0055-beyond-symlinks.sh b/t/t0055-beyond-symlinks.sh\nindex b29c37a..0c6ff56 100755\n--- a/t/t0055-beyond-symlinks.sh\n+++ b/t/t0055-beyond-symlinks.sh\n@@ -4,7 +4,7 @@ test_description='update-index and add refuse to add beyond symlinks'\n \n . ./test-lib.sh\n \n-test_expect_success setup '\n+test_expect_success SYMLINKS setup '\n \t>a &&\n \tmkdir b &&\n \tln -s b c &&\n@@ -12,12 +12,12 @@ test_expect_success setup '\n \tgit update-index --add a b/d\n '\n \n-test_expect_success 'update-index --add beyond symlinks' '\n+test_expect_success SYMLINKS 'update-index --add beyond symlinks' '\n \ttest_must_fail git update-index --add c/d &&\n \t! ( git ls-files | grep c/d )\n '\n \n-test_expect_success 'add beyond symlinks' '\n+test_expect_success SYMLINKS 'add beyond symlinks' '\n \ttest_must_fail git add c/d &&\n \t! ( git ls-files | grep c/d )\n '\ndiff --git a/t/t1004-read-tree-m-u-wf.sh b/t/t1004-read-tree-m-u-wf.sh\nindex 570d372..f19b4a2 100755\n--- a/t/t1004-read-tree-m-u-wf.sh\n+++ b/t/t1004-read-tree-m-u-wf.sh\n@@ -157,7 +157,7 @@ test_expect_success '3-way not overwriting local changes (their side)' '\n \n '\n \n-test_expect_success 'funny symlink in work tree' '\n+test_expect_success SYMLINKS 'funny symlink in work tree' '\n \n \tgit reset --hard &&\n \tgit checkout -b sym-b side-b &&\n@@ -177,7 +177,7 @@ test_expect_success 'funny symlink in work tree' '\n \n '\n \n-test_expect_success 'funny symlink in work tree, un-unlink-able' '\n+test_expect_success SYMLINKS 'funny symlink in work tree, un-unlink-able' '\n \n \trm -fr a b &&\n \tgit reset --hard &&\n@@ -189,7 +189,7 @@ test_expect_success 'funny symlink in work tree, un-unlink-able' '\n '\n \n # clean-up from the above test\n-chmod a+w a\n+chmod a+w a 2>/dev/null\n rm -fr a b\n \n test_expect_success 'D/F setup' '\ndiff --git a/t/t1020-subdirectory.sh b/t/t1020-subdirectory.sh\nindex fc386ba..210e594 100755\n--- a/t/t1020-subdirectory.sh\n+++ b/t/t1020-subdirectory.sh\n@@ -126,7 +126,7 @@ test_expect_success 'no file/rev ambiguity check inside a bare repo' '\n \tcd foo.git && git show -s HEAD\n '\n \n-test_expect_success 'detection should not be fooled by a symlink' '\n+test_expect_success SYMLINKS 'detection should not be fooled by a symlink' '\n \tcd \"$HERE\" &&\n \trm -fr foo.git &&\n \tgit clone -s .git another &&\ndiff --git a/t/t1300-repo-config.sh b/t/t1300-repo-config.sh\nindex 3c06842..64663e1 100755\n--- a/t/t1300-repo-config.sh\n+++ b/t/t1300-repo-config.sh\n@@ -726,7 +726,7 @@ echo >>result\n \n test_expect_success '--null --get-regexp' 'cmp result expect'\n \n-test_expect_success 'symlinked configuration' '\n+test_expect_success SYMLINKS 'symlinked configuration' '\n \n \tln -s notyet myconfig &&\n \tGIT_CONFIG=myconfig git config test.frotz nitfol &&\ndiff --git a/t/t2001-checkout-cache-clash.sh b/t/t2001-checkout-cache-clash.sh\nindex ef00753..98aa73e 100755\n--- a/t/t2001-checkout-cache-clash.sh\n+++ b/t/t2001-checkout-cache-clash.sh\n@@ -59,10 +59,10 @@ test_expect_success \\\n     'git read-tree -m $tree1 && git checkout-index -f -a'\n test_debug 'show_files $tree1'\n \n-ln -s path0 path1\n-test_expect_success \\\n+test_expect_success SYMLINKS \\\n     'git update-index --add a symlink.' \\\n-    'git update-index --add path1'\n+    'ln -s path0 path1 &&\n+     git update-index --add 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 71894b3..02a4fc5 100755\n--- a/t/t2003-checkout-cache-mkdir.sh\n+++ b/t/t2003-checkout-cache-mkdir.sh\n@@ -19,7 +19,7 @@ test_expect_success \\\n     echo rezrov >path1/file1 &&\n     git update-index --add path0 path1/file1'\n \n-test_expect_success \\\n+test_expect_success SYMLINKS \\\n     'have symlink in place where dir is expected.' \\\n     'rm -fr path0 path1 &&\n      mkdir path2 &&\n@@ -59,7 +59,7 @@ test_expect_success \\\n      test ! -f path1/file1'\n \n # Linus fix #1\n-test_expect_success \\\n+test_expect_success SYMLINKS \\\n     'use --prefix=tmp/orary/ where tmp is a symlink' \\\n     'rm -fr path0 path1 path2 tmp* &&\n      mkdir tmp1 tmp1/orary &&\n@@ -71,7 +71,7 @@ test_expect_success \\\n      test -h tmp'\n \n # Linus fix #2\n-test_expect_success \\\n+test_expect_success SYMLINKS \\\n     'use --prefix=tmp/orary- where tmp is a symlink' \\\n     'rm -fr path0 path1 path2 tmp* &&\n      mkdir tmp1 &&\n@@ -82,7 +82,7 @@ test_expect_success \\\n      test -h tmp'\n \n # Linus fix #3\n-test_expect_success \\\n+test_expect_success SYMLINKS \\\n     'use --prefix=tmp- where tmp-path1 is a symlink' \\\n     'rm -fr path0 path1 path2 tmp* &&\n      mkdir tmp1 &&\ndiff --git a/t/t2004-checkout-cache-temp.sh b/t/t2004-checkout-cache-temp.sh\nindex 39133b8..36cca14 100755\n--- a/t/t2004-checkout-cache-temp.sh\n+++ b/t/t2004-checkout-cache-temp.sh\n@@ -194,7 +194,7 @@ test_expect_success \\\n  test $(cat ../$s1) = tree1asubdir/path5)\n )'\n \n-test_expect_success \\\n+test_expect_success SYMLINKS \\\n 'checkout --temp symlink' '\n rm -f path* .merge_* out .git/index &&\n ln -s b a &&\ndiff --git a/t/t2007-checkout-symlink.sh b/t/t2007-checkout-symlink.sh\nindex 0526fce..20f3343 100755\n--- a/t/t2007-checkout-symlink.sh\n+++ b/t/t2007-checkout-symlink.sh\n@@ -6,6 +6,12 @@ test_description='git checkout to switch between branches with symlink<->dir'\n \n . ./test-lib.sh\n \n+if ! test_have_prereq SYMLINKS\n+then\n+\tsay \"symbolic links not supported - skipping tests\"\n+\ttest_done\n+fi\n+\n test_expect_success setup '\n \n \tmkdir frotz &&\ndiff --git a/t/t2100-update-cache-badpath.sh b/t/t2100-update-cache-badpath.sh\nindex 6ef2dcf..2df3fdd 100755\n--- a/t/t2100-update-cache-badpath.sh\n+++ b/t/t2100-update-cache-badpath.sh\n@@ -26,7 +26,12 @@ All of the attempts should fail.\n \n mkdir path2 path3\n date >path0\n-ln -s xyzzy path1\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@@ -38,7 +43,12 @@ rm -fr path?\n \n mkdir path0 path1\n date >path2\n-ln -s frotz path3\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 \ndiff --git a/t/t2200-add-update.sh b/t/t2200-add-update.sh\nindex 5a8d52f..9120750 100755\n--- a/t/t2200-add-update.sh\n+++ b/t/t2200-add-update.sh\n@@ -80,7 +80,7 @@ test_expect_success 'change gets noticed' '\n \n '\n \n-test_expect_success 'replace a file with a symlink' '\n+test_expect_success SYMLINKS 'replace a file with a symlink' '\n \n \trm foo &&\n \tln -s top foo &&\ndiff --git a/t/t2201-add-update-typechange.sh b/t/t2201-add-update-typechange.sh\nindex d24c7d9..2e8f702 100755\n--- a/t/t2201-add-update-typechange.sh\n+++ b/t/t2201-add-update-typechange.sh\n@@ -11,7 +11,13 @@ test_expect_success setup '\n \t_empty=$(git hash-object --stdin <xyzzy) &&\n \t>yomin &&\n \t>caskly &&\n-\tln -s frotz nitfol &&\n+\tif test_have_prereq SYMLINKS; then\n+\t\tln -s frotz nitfol &&\n+\t\tT_letter=T\n+\telse\n+\t\tprintf %s frotz > nitfol &&\n+\t\tT_letter=M\n+\tfi &&\n \tmkdir rezrov &&\n \t>rezrov/bozbar &&\n \tgit add caskly xyzzy yomin nitfol rezrov/bozbar &&\n@@ -29,7 +35,11 @@ test_expect_success modify '\n \t>nitfol &&\n \t# rezrov/bozbar disappears\n \trm -fr rezrov &&\n-\tln -s xyzzy rezrov &&\n+\tif test_have_prereq SYMLINKS; then\n+\t\tln -s xyzzy rezrov\n+\telse\n+\t\tprintf %s xyzzy > rezrov\n+\tfi &&\n \t# xyzzy disappears (not a submodule)\n \tmkdir xyzzy &&\n \techo gnusto >xyzzy/bozbar &&\n@@ -71,7 +81,7 @@ test_expect_success modify '\n \t\t\t\ts/blob/000000/\n \t\t\t}\n \t\t\t/\tnitfol/{\n-\t\t\t\ts/\tnitfol/ $_z40 T&/\n+\t\t\t\ts/\tnitfol/ $_z40 $T_letter&/\n \t\t\t\ts/blob/100644/\n \t\t\t}\n \t\t\t/\trezrov.bozbar/{\ndiff --git a/t/t2300-cd-to-toplevel.sh b/t/t2300-cd-to-toplevel.sh\nindex 293dc35..3b01ad2 100755\n--- a/t/t2300-cd-to-toplevel.sh\n+++ b/t/t2300-cd-to-toplevel.sh\n@@ -5,7 +5,7 @@ test_description='cd_to_toplevel'\n . ./test-lib.sh\n \n test_cd_to_toplevel () {\n-\ttest_expect_success \"$2\" '\n+\ttest_expect_success $3 \"$2\" '\n \t\t(\n \t\t\tcd '\"'$1'\"' &&\n \t\t\t. git-sh-setup &&\n@@ -24,14 +24,14 @@ test_cd_to_toplevel repo 'at physical root'\n \n test_cd_to_toplevel repo/sub/dir 'at physical subdir'\n \n-ln -s repo symrepo\n-test_cd_to_toplevel symrepo 'at symbolic root'\n+ln -s repo symrepo 2>/dev/null\n+test_cd_to_toplevel symrepo 'at symbolic root' SYMLINKS\n \n-ln -s repo/sub/dir subdir-link\n-test_cd_to_toplevel subdir-link 'at symbolic subdir'\n+ln -s repo/sub/dir subdir-link 2>/dev/null\n+test_cd_to_toplevel subdir-link 'at symbolic subdir' SYMLINKS\n \n cd repo\n-ln -s sub/dir internal-link\n-test_cd_to_toplevel internal-link 'at internal symbolic subdir'\n+ln -s sub/dir internal-link 2>/dev/null\n+test_cd_to_toplevel internal-link 'at internal symbolic subdir' SYMLINKS\n \n test_done\ndiff --git a/t/t3000-ls-files-others.sh b/t/t3000-ls-files-others.sh\nindex 36eee0f..b7e0306 100755\n--- a/t/t3000-ls-files-others.sh\n+++ b/t/t3000-ls-files-others.sh\n@@ -17,7 +17,12 @@ filesystem.\n . ./test-lib.sh\n \n date >path0\n-ln -s xyzzy path1\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 >path2-junk\ndiff --git a/t/t3010-ls-files-killed-modified.sh b/t/t3010-ls-files-killed-modified.sh\nindex e4f02a0..95671c2 100755\n--- a/t/t3010-ls-files-killed-modified.sh\n+++ b/t/t3010-ls-files-killed-modified.sh\n@@ -38,7 +38,12 @@ modified without reporting path9 and path10.\n . ./test-lib.sh\n \n date >path0\n-ln -s xyzzy path1\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@@ -52,8 +57,14 @@ test_expect_success \\\n \n rm -fr path? ;# leave path10 alone\n date >path2\n-ln -s frotz path3\n-ln -s nitfol path5\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\ndiff --git a/t/t3100-ls-tree-restrict.sh b/t/t3100-ls-tree-restrict.sh\nindex 6e6a254..ee60d03 100755\n--- a/t/t3100-ls-tree-restrict.sh\n+++ b/t/t3100-ls-tree-restrict.sh\n@@ -22,9 +22,21 @@ test_expect_success \\\n     'setup' \\\n     'mkdir path2 path2/baz &&\n      echo Hi >path0 &&\n-     ln -s path0 path1 &&\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      echo Lo >path2/foo &&\n-     ln -s ../path1 path2/bazbo &&\n      echo Mi >path2/baz/b &&\n      find path? \\( -type f -o -type l \\) -print |\n      xargs git update-index --add &&\n@@ -41,7 +53,7 @@ test_output () {\n test_expect_success \\\n     'ls-tree plain' \\\n     'git ls-tree $tree >current &&\n-     cat >expected <<\\EOF &&\n+     make_expected <<\\EOF &&\n 100644 blob X\tpath0\n 120000 blob X\tpath1\n 040000 tree X\tpath2\n@@ -51,7 +63,7 @@ EOF\n test_expect_success \\\n     'ls-tree recursive' \\\n     'git ls-tree -r $tree >current &&\n-     cat >expected <<\\EOF &&\n+     make_expected <<\\EOF &&\n 100644 blob X\tpath0\n 120000 blob X\tpath1\n 100644 blob X\tpath2/baz/b\n@@ -63,7 +75,7 @@ EOF\n test_expect_success \\\n     'ls-tree recursive with -t' \\\n     'git ls-tree -r -t $tree >current &&\n-     cat >expected <<\\EOF &&\n+     make_expected <<\\EOF &&\n 100644 blob X\tpath0\n 120000 blob X\tpath1\n 040000 tree X\tpath2\n@@ -77,7 +89,7 @@ EOF\n test_expect_success \\\n     'ls-tree recursive with -d' \\\n     'git ls-tree -r -d $tree >current &&\n-     cat >expected <<\\EOF &&\n+     make_expected <<\\EOF &&\n 040000 tree X\tpath2\n 040000 tree X\tpath2/baz\n EOF\n@@ -86,7 +98,7 @@ EOF\n test_expect_success \\\n     'ls-tree filtered with path' \\\n     'git ls-tree $tree path >current &&\n-     cat >expected <<\\EOF &&\n+     make_expected <<\\EOF &&\n EOF\n      test_output'\n \n@@ -96,7 +108,7 @@ EOF\n test_expect_success \\\n     'ls-tree filtered with path1 path0' \\\n     'git ls-tree $tree path1 path0 >current &&\n-     cat >expected <<\\EOF &&\n+     make_expected <<\\EOF &&\n 100644 blob X\tpath0\n 120000 blob X\tpath1\n EOF\n@@ -105,7 +117,7 @@ EOF\n test_expect_success \\\n     'ls-tree filtered with path0/' \\\n     'git ls-tree $tree path0/ >current &&\n-     cat >expected <<\\EOF &&\n+     make_expected <<\\EOF &&\n EOF\n      test_output'\n \n@@ -114,7 +126,7 @@ EOF\n test_expect_success \\\n     'ls-tree filtered with path2' \\\n     'git ls-tree $tree path2 >current &&\n-     cat >expected <<\\EOF &&\n+     make_expected <<\\EOF &&\n 040000 tree X\tpath2\n EOF\n      test_output'\n@@ -123,7 +135,7 @@ EOF\n test_expect_success \\\n     'ls-tree filtered with path2/' \\\n     'git ls-tree $tree path2/ >current &&\n-     cat >expected <<\\EOF &&\n+     make_expected <<\\EOF &&\n 040000 tree X\tpath2/baz\n 120000 blob X\tpath2/bazbo\n 100644 blob X\tpath2/foo\n@@ -135,7 +147,7 @@ EOF\n test_expect_success \\\n     'ls-tree filtered with path2/baz' \\\n     'git ls-tree $tree path2/baz >current &&\n-     cat >expected <<\\EOF &&\n+     make_expected <<\\EOF &&\n 040000 tree X\tpath2/baz\n EOF\n      test_output'\n@@ -143,14 +155,14 @@ EOF\n test_expect_success \\\n     'ls-tree filtered with path2/bak' \\\n     'git ls-tree $tree path2/bak >current &&\n-     cat >expected <<\\EOF &&\n+     make_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-     cat >expected <<\\EOF &&\n+     make_expected <<\\EOF &&\n 040000 tree X\tpath2\n EOF\n      test_output'\ndiff --git a/t/t3200-branch.sh b/t/t3200-branch.sh\nindex 61a2010..f82bcdb 100755\n--- a/t/t3200-branch.sh\n+++ b/t/t3200-branch.sh\n@@ -121,7 +121,7 @@ test_expect_success 'renaming a symref is not allowed' \\\n \t! test -f .git/refs/heads/master3\n '\n \n-test_expect_success \\\n+test_expect_success SYMLINKS \\\n     'git branch -m u v should fail when the reflog for u is a symlink' '\n      git branch -l u &&\n      mv .git/logs/refs/heads/u real-u &&\ndiff --git a/t/t3700-add.sh b/t/t3700-add.sh\nindex 9f6454d..e98f982 100755\n--- a/t/t3700-add.sh\n+++ b/t/t3700-add.sh\n@@ -30,7 +30,7 @@ test_expect_success \\\n \t *) echo fail; git ls-files --stage xfoo1; (exit 1);;\n \t esac'\n \n-test_expect_success 'git add: filemode=0 should not get confused by symlink' '\n+test_expect_success SYMLINKS 'git add: filemode=0 should not get confused by symlink' '\n \trm -f xfoo1 &&\n \tln -s foo xfoo1 &&\n \tgit add xfoo1 &&\n@@ -51,7 +51,7 @@ test_expect_success \\\n \t *) echo fail; git ls-files --stage xfoo2; (exit 1);;\n \t esac'\n \n-test_expect_success 'git add: filemode=0 should not get confused by symlink' '\n+test_expect_success SYMLINKS '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@@ -61,7 +61,7 @@ test_expect_success 'git add: filemode=0 should not get confused by symlink' '\n \tesac\n '\n \n-test_expect_success \\\n+test_expect_success SYMLINKS \\\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 &&\ndiff --git a/t/t4004-diff-rename-symlink.sh b/t/t4004-diff-rename-symlink.sh\nindex b35af9b..3db7444 100755\n--- a/t/t4004-diff-rename-symlink.sh\n+++ b/t/t4004-diff-rename-symlink.sh\n@@ -12,6 +12,13 @@ by an edit for them.\n . ./test-lib.sh\n . \"$TEST_DIRECTORY\"/diff-lib.sh\n \n+if ! test_have_prereq SYMLINKS\n+then\n+\tsay 'Symbolic links not supported, skipping tests.'\n+\ttest_done\n+\texit\n+fi\n+\n test_expect_success \\\n     'prepare reference tree' \\\n     'echo xyzzy | tr -d '\\\\\\\\'012 >yomin &&\ndiff --git a/t/t4008-diff-break-rewrite.sh b/t/t4008-diff-break-rewrite.sh\nindex 7e343a9..e19ca65 100755\n--- a/t/t4008-diff-break-rewrite.sh\n+++ b/t/t4008-diff-break-rewrite.sh\n@@ -99,7 +99,7 @@ test_expect_success \\\n     'validate result of -B -M (#4)' \\\n     'compare_diff_raw expected current'\n \n-test_expect_success \\\n+test_expect_success SYMLINKS \\\n     'make file0 into something completely different' \\\n     'rm -f file0 &&\n      ln -s frotz file0 &&\n@@ -114,7 +114,7 @@ cat >expected <<\\EOF\n :100644 100644 6ff87c4664981e4397625791c8ea3bbb5f2279a3 f5deac7be59e7eeab8657fd9ae706fd6a57daed2 M100\tfile1\n EOF\n \n-test_expect_success \\\n+test_expect_success SYMLINKS \\\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 \\\n+test_expect_success SYMLINKS \\\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 \\\n+test_expect_success SYMLINKS \\\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 9055c8b..3a81309 100755\n--- a/t/t4011-diff-symlink.sh\n+++ b/t/t4011-diff-symlink.sh\n@@ -9,6 +9,13 @@ test_description='Test diff of symlinks.\n . ./test-lib.sh\n . \"$TEST_DIRECTORY\"/diff-lib.sh\n \n+if ! test_have_prereq SYMLINKS\n+then\n+\tsay 'Symbolic links not supported, skipping tests.'\n+\ttest_done\n+\texit\n+fi\n+\n cat > expected << EOF\n diff --git a/frotz b/frotz\n new file mode 120000\ndiff --git a/t/t4023-diff-rename-typechange.sh b/t/t4023-diff-rename-typechange.sh\nindex 297ddb5..5099862 100755\n--- a/t/t4023-diff-rename-typechange.sh\n+++ b/t/t4023-diff-rename-typechange.sh\n@@ -4,6 +4,13 @@ test_description='typechange rename detection'\n \n . ./test-lib.sh\n \n+if ! test_have_prereq SYMLINKS\n+then\n+\tsay 'Symbolic links not supported, skipping tests.'\n+\ttest_done\n+\texit\n+fi\n+\n test_expect_success setup '\n \n \trm -f foo bar &&\ndiff --git a/t/t4114-apply-typechange.sh b/t/t4114-apply-typechange.sh\nindex 0f185ca..7dc35de 100755\n--- a/t/t4114-apply-typechange.sh\n+++ b/t/t4114-apply-typechange.sh\n@@ -9,6 +9,13 @@ test_description='git apply should not get confused with type changes.\n \n . ./test-lib.sh\n \n+if ! test_have_prereq SYMLINKS\n+then\n+\tsay 'Symbolic links not supported, skipping tests.'\n+\ttest_done\n+\texit\n+fi\n+\n test_expect_success 'setup repository and commits' '\n \techo \"hello world\" > foo &&\n \techo \"hi planet\" > bar &&\ndiff --git a/t/t4115-apply-symlink.sh b/t/t4115-apply-symlink.sh\nindex 9ace578..1a3aea3 100755\n--- a/t/t4115-apply-symlink.sh\n+++ b/t/t4115-apply-symlink.sh\n@@ -9,6 +9,13 @@ test_description='git apply symlinks and partial files\n \n . ./test-lib.sh\n \n+if ! test_have_prereq SYMLINKS\n+then\n+\tsay 'Symbolic links not supported, skipping tests.'\n+\ttest_done\n+\texit\n+fi\n+\n test_expect_success setup '\n \n \tln -s path1/path2/path3/path4/path5 link1 &&\ndiff --git a/t/t4122-apply-symlink-inside.sh b/t/t4122-apply-symlink-inside.sh\nindex 841773f..8aad20b 100755\n--- a/t/t4122-apply-symlink-inside.sh\n+++ b/t/t4122-apply-symlink-inside.sh\n@@ -3,6 +3,13 @@\n test_description='apply to deeper directory without getting fooled with symlink'\n . ./test-lib.sh\n \n+if ! test_have_prereq SYMLINKS\n+then\n+\tsay 'Symbolic links not supported, skipping tests.'\n+\ttest_done\n+\texit\n+fi\n+\n lecho () {\n \tfor l_\n \tdo\ndiff --git a/t/t5000-tar-tree.sh b/t/t5000-tar-tree.sh\nindex 7a84ab6..60a4b8d 100755\n--- a/t/t5000-tar-tree.sh\n+++ b/t/t5000-tar-tree.sh\n@@ -37,7 +37,11 @@ test_expect_success \\\n      cp /bin/sh a/bin &&\n      printf \"A\\$Format:%s\\$O\" \"$SUBSTFORMAT\" >a/substfile1 &&\n      printf \"A not substituted O\" >a/substfile2 &&\n-     ln -s a a/l1 &&\n+     if test_have_prereq SYMLINKS; then\n+\tln -s a a/l1\n+     else\n+\tprintf %s a > a/l1\n+     fi &&\n      (p=long_path_to_a_file && cd a &&\n       for depth in 1 2 3 4 5; do mkdir $p && cd $p; done &&\n       echo text >file_with_long_path) &&\ndiff --git a/t/t5522-pull-symlink.sh b/t/t5522-pull-symlink.sh\nindex 5672b51..d887eb6 100755\n--- a/t/t5522-pull-symlink.sh\n+++ b/t/t5522-pull-symlink.sh\n@@ -4,6 +4,13 @@ test_description='pulling from symlinked subdir'\n \n . ./test-lib.sh\n \n+if ! test_have_prereq SYMLINKS\n+then\n+\tsay 'Symbolic links not supported, skipping tests.'\n+\ttest_done\n+\texit\n+fi\n+\n # The scenario we are building:\n #\n #   trash\\ directory/\ndiff --git a/t/t7001-mv.sh b/t/t7001-mv.sh\nindex 8fb3a56..10b8f8c 100755\n--- a/t/t7001-mv.sh\n+++ b/t/t7001-mv.sh\n@@ -206,7 +206,7 @@ test_expect_success 'git mv should not change sha1 of moved cache entry' '\n \n rm -f dirty dirty2\n \n-test_expect_success 'git mv should overwrite symlink to a file' '\n+test_expect_success SYMLINKS 'git mv should overwrite symlink to a file' '\n \n \trm -fr .git &&\n \tgit init &&\n@@ -225,7 +225,7 @@ test_expect_success 'git mv should overwrite symlink to a file' '\n \n rm -f moved symlink\n \n-test_expect_success 'git mv should overwrite file with a symlink' '\n+test_expect_success SYMLINKS 'git mv should overwrite file with a symlink' '\n \n \trm -fr .git &&\n \tgit init &&\ndiff --git a/t/t9131-git-svn-empty-symlink.sh b/t/t9131-git-svn-empty-symlink.sh\nindex 8f35e29..9a24a65 100755\n--- a/t/t9131-git-svn-empty-symlink.sh\n+++ b/t/t9131-git-svn-empty-symlink.sh\n@@ -88,7 +88,7 @@ test_expect_success 'enable broken symlink workaround' \\\n test_expect_success '\"bar\" is an empty file' 'test -f x/bar && ! test -s x/bar'\n test_expect_success 'get \"bar\" => symlink fix from svn' \\\n \t\t'(cd x && git svn rebase)'\n-test_expect_success '\"bar\" becomes a symlink' 'test -L x/bar'\n+test_expect_success SYMLINKS '\"bar\" becomes a symlink' 'test -L x/bar'\n \n \n test_expect_success 'clone using git svn' 'git svn clone -r1 \"$svnrepo\" y'\ndiff --git a/t/t9132-git-svn-broken-symlink.sh b/t/t9132-git-svn-broken-symlink.sh\nindex b8de59e..6c4c90b 100755\n--- a/t/t9132-git-svn-broken-symlink.sh\n+++ b/t/t9132-git-svn-broken-symlink.sh\n@@ -85,7 +85,7 @@ EOF\n \n test_expect_success 'clone using git svn' 'git svn clone -r1 \"$svnrepo\" x'\n \n-test_expect_success '\"bar\" is a symlink that points to \"asdf\"' '\n+test_expect_success SYMLINKS '\"bar\" is a symlink that points to \"asdf\"' '\n \ttest -L x/bar &&\n \t(cd x && test xasdf = x\"`git cat-file blob HEAD:bar`\")\n '\n@@ -94,7 +94,7 @@ test_expect_success 'get \"bar\" => symlink fix from svn' '\n \t(cd x && git svn rebase)\n '\n \n-test_expect_success '\"bar\" remains a proper symlink' '\n+test_expect_success SYMLINKS '\"bar\" remains a proper symlink' '\n \ttest -L x/bar &&\n \t(cd x && test xdoink = x\"`git cat-file blob HEAD:bar`\")\n '\ndiff --git a/t/t9500-gitweb-standalone-no-errors.sh b/t/t9500-gitweb-standalone-no-errors.sh\nindex dce06bc..9ec5030 100755\n--- a/t/t9500-gitweb-standalone-no-errors.sh\n+++ b/t/t9500-gitweb-standalone-no-errors.sh\n@@ -246,7 +246,7 @@ test_expect_success \\\n \t gitweb_run \"p=.git;a=commitdiff\"'\n test_debug 'cat gitweb.log'\n \n-test_expect_success \\\n+test_expect_success SYMLINKS \\\n \t'commitdiff(0): file to symlink' \\\n \t'rm renamed_file &&\n \t ln -s file renamed_file &&\n@@ -308,7 +308,7 @@ test_debug 'cat gitweb.log'\n # ----------------------------------------------------------------------\n # commitdiff testing (taken from t4114-apply-typechange.sh)\n \n-test_expect_success 'setup typechange commits' '\n+test_expect_success SYMLINKS 'setup typechange commits' '\n \techo \"hello world\" > foo &&\n \techo \"hi planet\" > bar &&\n \tgit update-index --add foo bar &&\n@@ -418,7 +418,12 @@ test_expect_success \\\n \t git mv 04-rename-from 04-rename-to &&\n \t echo \"Changed\" >> 04-rename-to &&\n \t test_chmod +x 05-mode-change &&\n-\t rm -f 06-file-or-symlink && ln -s 01-change 06-file-or-symlink &&\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 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\" &&\ndiff --git a/t/test-lib.sh b/t/test-lib.sh\nindex 3c65cfe..5337e89 100644\n--- a/t/test-lib.sh\n+++ b/t/test-lib.sh\n@@ -689,3 +689,7 @@ case $(uname -s) in\n \t}\n \t;;\n esac\n+\n+# test whether the filesystem supports symbolic links\n+ln -s x y 2>/dev/null && test -h y 2>/dev/null && test_set_prereq SYMLINKS\n+rm -f y\n-- \n1.6.2.1.224.g2225f\n"},{"id":"108819","messageId":"9af33285b3e0a797090b5ff28d982b06ff3a63b0.1237667830.git.j6t@kdbg.org","threadId":"18451","inReplyTo":"cover.1237667830.git.j6t@kdbg.org","subject":"[PATCH 11/16] t0060: Fix tests on Windows","fromName":"Johannes Sixt","fromEmail":"j6t@kdbg.org","sentAt":"2009-03-21T21:26:34Z","receivedAt":"2009-03-21T21:26:34Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Since the MSYS bash mangles absolute paths that it passes as command line\narguments to non-MSYS progams (such as git or test-path-utils), we have to\nbend over backwards to squeeze some usefulness out of the existing tests.\n\nIn particular, a set of path normalization tests is added that test\nrelative paths. Some paths in the ancestor path tests are adjusted to help\nMSYS bash's path mangling heuristics.\n\nSigned-off-by: Johannes Sixt <j6t@kdbg.org>\n---\n t/t0060-path-utils.sh |  116 +++++++++++++++++++++++++++++++++++--------------\n 1 files changed, 83 insertions(+), 33 deletions(-)\n\ndiff --git a/t/t0060-path-utils.sh b/t/t0060-path-utils.sh\nindex 8336114..86000e2 100755\n--- a/t/t0060-path-utils.sh\n+++ b/t/t0060-path-utils.sh\n@@ -7,41 +7,91 @@ test_description='Test various path utilities'\n \n . ./test-lib.sh\n \n-norm_abs() {\n-\ttest_expect_success \"normalize absolute: $1 => $2\" \\\n+norm_path() {\n+\ttest_expect_success $3 \"normalize path: $1 => $2\" \\\n \t\"test \\\"\\$(test-path-utils normalize_path_copy '$1')\\\" = '$2'\"\n }\n \n+# On Windows, we are using MSYS's bash, which mangles the paths.\n+# Absolute paths are anchored at the MSYS installation directory,\n+# which means that the path / accounts for this many characters:\n+rootoff=$(test-path-utils normalize_path_copy / | wc -c)\n+# Account for the trailing LF:\n+if test \"$rootoff\" = 2; then\n+\trootoff=\t# we are on Unix\n+else\n+\trootoff=$(($rootoff-1))\n+fi\n+\n ancestor() {\n-\ttest_expect_success \"longest ancestor: $1 $2 => $3\" \\\n-\t\"test \\\"\\$(test-path-utils longest_ancestor_length '$1' '$2')\\\" = '$3'\"\n+\t# We do some math with the expected ancestor length.\n+\texpected=$3\n+\tif test -n \"$rootoff\" && test \"x$expected\" != x-1; then\n+\t\texpected=$(($expected+$rootoff))\n+\tfi\n+\ttest_expect_success \"longest ancestor: $1 $2 => $expected\" \\\n+\t\"actual=\\$(test-path-utils longest_ancestor_length '$1' '$2') &&\n+\t test \\\"\\$actual\\\" = '$expected'\"\n }\n \n-norm_abs \"\" \"\"\n-norm_abs / /\n-norm_abs // /\n-norm_abs /// /\n-norm_abs /. /\n-norm_abs /./ /\n-norm_abs /./.. ++failed++\n-norm_abs /../. ++failed++\n-norm_abs /./../.// ++failed++\n-norm_abs /dir/.. /\n-norm_abs /dir/sub/../.. /\n-norm_abs /dir/sub/../../.. ++failed++\n-norm_abs /dir /dir\n-norm_abs /dir// /dir/\n-norm_abs /./dir /dir\n-norm_abs /dir/. /dir/\n-norm_abs /dir///./ /dir/\n-norm_abs /dir//sub/.. /dir/\n-norm_abs /dir/sub/../ /dir/\n-norm_abs //dir/sub/../. /dir/\n-norm_abs /dir/s1/../s2/ /dir/s2/\n-norm_abs /d1/s1///s2/..//../s3/ /d1/s3/\n-norm_abs /d1/s1//../s2/../../d2 /d2\n-norm_abs /d1/.../d2 /d1/.../d2\n-norm_abs /d1/..././../d2 /d1/d2\n+# Absolute path tests must be skipped on Windows because due to path mangling\n+# the test program never sees a POSIX-style absolute path\n+case $(uname -s) in\n+*MINGW*)\n+\t;;\n+*)\n+\ttest_set_prereq POSIX\n+\t;;\n+esac\n+\n+norm_path \"\" \"\"\n+norm_path . \"\"\n+norm_path ./ \"\"\n+norm_path ./. \"\"\n+norm_path ./.. ++failed++\n+norm_path ../. ++failed++\n+norm_path ./../.// ++failed++\n+norm_path dir/.. \"\"\n+norm_path dir/sub/../.. \"\"\n+norm_path dir/sub/../../.. ++failed++\n+norm_path dir dir\n+norm_path dir// dir/\n+norm_path ./dir dir\n+norm_path dir/. dir/\n+norm_path dir///./ dir/\n+norm_path dir//sub/.. dir/\n+norm_path dir/sub/../ dir/\n+norm_path dir/sub/../. dir/\n+norm_path dir/s1/../s2/ dir/s2/\n+norm_path d1/s1///s2/..//../s3/ d1/s3/\n+norm_path d1/s1//../s2/../../d2 d2\n+norm_path d1/.../d2 d1/.../d2\n+norm_path d1/..././../d2 d1/d2\n+\n+norm_path / / POSIX\n+norm_path // / POSIX\n+norm_path /// / POSIX\n+norm_path /. / POSIX\n+norm_path /./ / POSIX\n+norm_path /./.. ++failed++ POSIX\n+norm_path /../. ++failed++ POSIX\n+norm_path /./../.// ++failed++ POSIX\n+norm_path /dir/.. / POSIX\n+norm_path /dir/sub/../.. / POSIX\n+norm_path /dir/sub/../../.. ++failed++ POSIX\n+norm_path /dir /dir POSIX\n+norm_path /dir// /dir/ POSIX\n+norm_path /./dir /dir POSIX\n+norm_path /dir/. /dir/ POSIX\n+norm_path /dir///./ /dir/ POSIX\n+norm_path /dir//sub/.. /dir/ POSIX\n+norm_path /dir/sub/../ /dir/ POSIX\n+norm_path //dir/sub/../. /dir/ POSIX\n+norm_path /dir/s1/../s2/ /dir/s2/ POSIX\n+norm_path /d1/s1///s2/..//../s3/ /d1/s3/ POSIX\n+norm_path /d1/s1//../s2/../../d2 /d2 POSIX\n+norm_path /d1/.../d2 /d1/.../d2 POSIX\n+norm_path /d1/..././../d2 /d1/d2 POSIX\n \n ancestor / \"\" -1\n ancestor / / -1\n@@ -80,10 +130,10 @@ ancestor /foo/bar /:/foo:/bar/ 4\n ancestor /foo/bar /foo:/:/bar/ 4\n ancestor /foo/bar /:/bar/:/fo 0\n ancestor /foo/bar /:/bar/ 0\n-ancestor /foo/bar :://foo/. 4\n-ancestor /foo/bar :://foo/.:: 4\n-ancestor /foo/bar //foo/./::/bar 4\n-ancestor /foo/bar ::/bar -1\n+ancestor /foo/bar .:/foo/. 4\n+ancestor /foo/bar .:/foo/.:.: 4\n+ancestor /foo/bar /foo/./:.:/bar 4\n+ancestor /foo/bar .:/bar -1\n \n test_expect_success 'strip_path_suffix' '\n \ttest c:/msysgit = $(test-path-utils strip_path_suffix \\\n-- \n1.6.2.1.224.g2225f\n"},{"id":"108827","messageId":"3dc085c7ad60932b21595dab3d6b1f062eb570d5.1237667830.git.j6t@kdbg.org","threadId":"18451","inReplyTo":"cover.1237667830.git.j6t@kdbg.org","subject":"[PATCH 12/16] Skip tests that require a filesystem that obeys POSIX permissions","fromName":"Johannes Sixt","fromEmail":"j6t@kdbg.org","sentAt":"2009-03-21T21:26:35Z","receivedAt":"2009-03-21T21:26:35Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Signed-off-by: Johannes Sixt <j6t@kdbg.org>\n---\n t/t0004-unwritable.sh      |    8 ++++----\n t/t1301-shared-repo.sh     |   10 +++++-----\n t/t3700-add.sh             |    8 ++++----\n t/t7503-pre-commit-hook.sh |    4 ++--\n t/t7504-commit-msg-hook.sh |    8 ++++----\n t/test-lib.sh              |    4 ++++\n 6 files changed, 23 insertions(+), 19 deletions(-)\n\ndiff --git a/t/t0004-unwritable.sh b/t/t0004-unwritable.sh\nindex 63e1217..2342ac5 100755\n--- a/t/t0004-unwritable.sh\n+++ b/t/t0004-unwritable.sh\n@@ -15,7 +15,7 @@ test_expect_success setup '\n \n '\n \n-test_expect_success 'write-tree should notice unwritable repository' '\n+test_expect_success POSIXPERM 'write-tree should notice unwritable repository' '\n \n \t(\n \t\tchmod a-w .git/objects .git/objects/?? &&\n@@ -27,7 +27,7 @@ test_expect_success 'write-tree should notice unwritable repository' '\n \n '\n \n-test_expect_success 'commit should notice unwritable repository' '\n+test_expect_success POSIXPERM 'commit should notice unwritable repository' '\n \n \t(\n \t\tchmod a-w .git/objects .git/objects/?? &&\n@@ -39,7 +39,7 @@ test_expect_success 'commit should notice unwritable repository' '\n \n '\n \n-test_expect_success 'update-index should notice unwritable repository' '\n+test_expect_success POSIXPERM 'update-index should notice unwritable repository' '\n \n \t(\n \t\techo 6O >file &&\n@@ -52,7 +52,7 @@ test_expect_success 'update-index should notice unwritable repository' '\n \n '\n \n-test_expect_success 'add should notice unwritable repository' '\n+test_expect_success POSIXPERM 'add should notice unwritable repository' '\n \n \t(\n \t\techo b >file &&\ndiff --git a/t/t1301-shared-repo.sh b/t/t1301-shared-repo.sh\nindex 653362b..dc44854 100755\n--- a/t/t1301-shared-repo.sh\n+++ b/t/t1301-shared-repo.sh\n@@ -26,7 +26,7 @@ modebits () {\n \n for u in 002 022\n do\n-\ttest_expect_success \"shared=1 does not clear bits preset by umask $u\" '\n+\ttest_expect_success POSIXPERM \"shared=1 does not clear bits preset by umask $u\" '\n \t\tmkdir sub && (\n \t\t\tcd sub &&\n \t\t\tumask $u &&\n@@ -54,7 +54,7 @@ test_expect_success 'shared=all' '\n \ttest 2 = $(git config core.sharedrepository)\n '\n \n-test_expect_success 'update-server-info honors core.sharedRepository' '\n+test_expect_success POSIXPERM 'update-server-info honors core.sharedRepository' '\n \t: > a1 &&\n \tgit add a1 &&\n \ttest_tick &&\n@@ -85,7 +85,7 @@ do\n \tgit config core.sharedrepository \"$u\" &&\n \tumask 0277 &&\n \n-\ttest_expect_success \"shared = $u ($y) ro\" '\n+\ttest_expect_success POSIXPERM \"shared = $u ($y) ro\" '\n \n \t\trm -f .git/info/refs &&\n \t\tgit update-server-info &&\n@@ -97,7 +97,7 @@ do\n \t'\n \n \tumask 077 &&\n-\ttest_expect_success \"shared = $u ($x) rw\" '\n+\ttest_expect_success POSIXPERM \"shared = $u ($x) rw\" '\n \n \t\trm -f .git/info/refs &&\n \t\tgit update-server-info &&\n@@ -111,7 +111,7 @@ do\n \n done\n \n-test_expect_success 'git reflog expire honors core.sharedRepository' '\n+test_expect_success POSIXPERM 'git reflog expire honors core.sharedRepository' '\n \tgit config core.sharedRepository group &&\n \tgit reflog expire --all &&\n \tactual=\"$(ls -l .git/logs/refs/heads/master)\" &&\ndiff --git a/t/t3700-add.sh b/t/t3700-add.sh\nindex e98f982..dc17d9f 100755\n--- a/t/t3700-add.sh\n+++ b/t/t3700-add.sh\n@@ -179,7 +179,7 @@ test_expect_success 'git add --refresh' '\n \ttest -z \"`git diff-index HEAD -- foo`\"\n '\n \n-test_expect_success 'git add should fail atomically upon an unreadable file' '\n+test_expect_success POSIXPERM 'git add should fail atomically upon an unreadable file' '\n \tgit reset --hard &&\n \tdate >foo1 &&\n \tdate >foo2 &&\n@@ -190,7 +190,7 @@ test_expect_success 'git add should fail atomically upon an unreadable file' '\n \n rm -f foo2\n \n-test_expect_success 'git add --ignore-errors' '\n+test_expect_success POSIXPERM 'git add --ignore-errors' '\n \tgit reset --hard &&\n \tdate >foo1 &&\n \tdate >foo2 &&\n@@ -201,7 +201,7 @@ test_expect_success 'git add --ignore-errors' '\n \n rm -f foo2\n \n-test_expect_success 'git add (add.ignore-errors)' '\n+test_expect_success POSIXPERM 'git add (add.ignore-errors)' '\n \tgit config add.ignore-errors 1 &&\n \tgit reset --hard &&\n \tdate >foo1 &&\n@@ -212,7 +212,7 @@ test_expect_success 'git add (add.ignore-errors)' '\n '\n rm -f foo2\n \n-test_expect_success 'git add (add.ignore-errors = false)' '\n+test_expect_success POSIXPERM 'git add (add.ignore-errors = false)' '\n \tgit config add.ignore-errors 0 &&\n \tgit reset --hard &&\n \tdate >foo1 &&\ndiff --git a/t/t7503-pre-commit-hook.sh b/t/t7503-pre-commit-hook.sh\nindex b069095..8528f64 100755\n--- a/t/t7503-pre-commit-hook.sh\n+++ b/t/t7503-pre-commit-hook.sh\n@@ -69,7 +69,7 @@ test_expect_success '--no-verify with failing hook' '\n '\n \n chmod -x \"$HOOK\"\n-test_expect_success 'with non-executable hook' '\n+test_expect_success POSIXPERM 'with non-executable hook' '\n \n \techo \"content\" >> file &&\n \tgit add file &&\n@@ -77,7 +77,7 @@ test_expect_success 'with non-executable hook' '\n \n '\n \n-test_expect_success '--no-verify with non-executable hook' '\n+test_expect_success POSIXPERM '--no-verify with non-executable hook' '\n \n \techo \"more content\" >> file &&\n \tgit add file &&\ndiff --git a/t/t7504-commit-msg-hook.sh b/t/t7504-commit-msg-hook.sh\nindex 47680e6..1f53ea8 100755\n--- a/t/t7504-commit-msg-hook.sh\n+++ b/t/t7504-commit-msg-hook.sh\n@@ -136,7 +136,7 @@ test_expect_success '--no-verify with failing hook (editor)' '\n '\n \n chmod -x \"$HOOK\"\n-test_expect_success 'with non-executable hook' '\n+test_expect_success POSIXPERM 'with non-executable hook' '\n \n \techo \"content\" >> file &&\n \tgit add file &&\n@@ -144,7 +144,7 @@ test_expect_success 'with non-executable hook' '\n \n '\n \n-test_expect_success 'with non-executable hook (editor)' '\n+test_expect_success POSIXPERM 'with non-executable hook (editor)' '\n \n \techo \"content again\" >> file &&\n \tgit add file &&\n@@ -153,7 +153,7 @@ test_expect_success 'with non-executable hook (editor)' '\n \n '\n \n-test_expect_success '--no-verify with non-executable hook' '\n+test_expect_success POSIXPERM '--no-verify with non-executable hook' '\n \n \techo \"more content\" >> file &&\n \tgit add file &&\n@@ -161,7 +161,7 @@ test_expect_success '--no-verify with non-executable hook' '\n \n '\n \n-test_expect_success '--no-verify with non-executable hook (editor)' '\n+test_expect_success POSIXPERM '--no-verify with non-executable hook (editor)' '\n \n \techo \"even more content\" >> file &&\n \tgit add file &&\ndiff --git a/t/test-lib.sh b/t/test-lib.sh\nindex 5337e89..f134e73 100644\n--- a/t/test-lib.sh\n+++ b/t/test-lib.sh\n@@ -687,6 +687,10 @@ case $(uname -s) in\n \tpwd () {\n \t\tbuiltin pwd -W\n \t}\n+\t# no POSIX permissions\n+\t;;\n+*)\n+\ttest_set_prereq POSIXPERM\n \t;;\n esac\n \n-- \n1.6.2.1.224.g2225f\n"},{"id":"108822","messageId":"6acd113f60d1b0e7926386f3aebe5d72ad362034.1237667830.git.j6t@kdbg.org","threadId":"18451","inReplyTo":"cover.1237667830.git.j6t@kdbg.org","subject":"[PATCH 13/16] t3700: Skip a test with backslashes in pathspec","fromName":"Johannes Sixt","fromEmail":"j6t@kdbg.org","sentAt":"2009-03-21T21:26:36Z","receivedAt":"2009-03-21T21:26:36Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Signed-off-by: Johannes Sixt <j6t@kdbg.org>\n---\n t/t3700-add.sh |    2 +-\n t/test-lib.sh  |    2 ++\n 2 files changed, 3 insertions(+), 1 deletions(-)\n\ndiff --git a/t/t3700-add.sh b/t/t3700-add.sh\nindex dc17d9f..050de42 100755\n--- a/t/t3700-add.sh\n+++ b/t/t3700-add.sh\n@@ -222,7 +222,7 @@ test_expect_success POSIXPERM 'git add (add.ignore-errors = false)' '\n \t! ( git ls-files foo1 | grep foo1 )\n '\n \n-test_expect_success 'git add '\\''fo\\[ou\\]bar'\\'' ignores foobar' '\n+test_expect_success BSLASHPSPEC \"git add 'fo\\\\[ou\\\\]bar' ignores foobar\" '\n \tgit reset --hard &&\n \ttouch fo\\[ou\\]bar foobar &&\n \tgit add '\\''fo\\[ou\\]bar'\\'' &&\ndiff --git a/t/test-lib.sh b/t/test-lib.sh\nindex f134e73..b4b626e 100644\n--- a/t/test-lib.sh\n+++ b/t/test-lib.sh\n@@ -688,9 +688,11 @@ case $(uname -s) in\n \t\tbuiltin pwd -W\n \t}\n \t# no POSIX permissions\n+\t# backslashes in pathspec are converted to '/'\n \t;;\n *)\n \ttest_set_prereq POSIXPERM\n+\ttest_set_prereq BSLASHPSPEC\n \t;;\n esac\n \n-- \n1.6.2.1.224.g2225f\n"},{"id":"108826","messageId":"a71ced1bacf2d05b1df6946d419331b8aa3e5a27.1237667830.git.j6t@kdbg.org","threadId":"18451","inReplyTo":"cover.1237667830.git.j6t@kdbg.org","subject":"[PATCH 14/16] Use prerequisites to skip tests that need unzip","fromName":"Johannes Sixt","fromEmail":"j6t@kdbg.org","sentAt":"2009-03-21T21:26:37Z","receivedAt":"2009-03-21T21:26:37Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Signed-off-by: Johannes Sixt <j6t@kdbg.org>\n---\n t/t0024-crlf-archive.sh |    6 +++---\n t/t5000-tar-tree.sh     |   16 ++++++++--------\n 2 files changed, 11 insertions(+), 11 deletions(-)\n\ndiff --git a/t/t0024-crlf-archive.sh b/t/t0024-crlf-archive.sh\nindex ae90d34..c7d0324 100755\n--- a/t/t0024-crlf-archive.sh\n+++ b/t/t0024-crlf-archive.sh\n@@ -29,11 +29,11 @@ test_expect_success 'tar archive' '\n \"$UNZIP\" -v >/dev/null 2>&1\n if [ $? -eq 127 ]; then\n \tsay \"Skipping ZIP test, because unzip was not found\"\n-\ttest_done\n-\texit\n+else\n+\ttest_set_prereq UNZIP\n fi\n \n-test_expect_success 'zip archive' '\n+test_expect_success UNZIP 'zip archive' '\n \n \tgit archive --format=zip HEAD >test.zip &&\n \ndiff --git a/t/t5000-tar-tree.sh b/t/t5000-tar-tree.sh\nindex 60a4b8d..7641e0d 100755\n--- a/t/t5000-tar-tree.sh\n+++ b/t/t5000-tar-tree.sh\n@@ -187,20 +187,20 @@ test_expect_success 'git archive --format=zip with --output' \\\n $UNZIP -v >/dev/null 2>&1\n if [ $? -eq 127 ]; then\n \tsay \"Skipping ZIP tests, because unzip was not found\"\n-\ttest_done\n-\texit\n+else\n+\ttest_set_prereq UNZIP\n fi\n \n-test_expect_success \\\n+test_expect_success UNZIP \\\n     'extract ZIP archive' \\\n     '(mkdir d && cd d && $UNZIP ../d.zip)'\n \n-test_expect_success \\\n+test_expect_success UNZIP \\\n     'validate filenames' \\\n     '(cd d/a && find .) | sort >d.lst &&\n      test_cmp a.lst d.lst'\n \n-test_expect_success \\\n+test_expect_success UNZIP \\\n     'validate file contents' \\\n     'diff -r a d/a'\n \n@@ -208,16 +208,16 @@ test_expect_success \\\n     'git archive --format=zip with prefix' \\\n     'git archive --format=zip --prefix=prefix/ HEAD >e.zip'\n \n-test_expect_success \\\n+test_expect_success UNZIP \\\n     'extract ZIP archive with prefix' \\\n     '(mkdir e && cd e && $UNZIP ../e.zip)'\n \n-test_expect_success \\\n+test_expect_success UNZIP \\\n     'validate filenames with prefix' \\\n     '(cd e/prefix/a && find .) | sort >e.lst &&\n      test_cmp a.lst e.lst'\n \n-test_expect_success \\\n+test_expect_success UNZIP \\\n     'validate file contents with prefix' \\\n     'diff -r a e/prefix/a'\n \n-- \n1.6.2.1.224.g2225f\n"},{"id":"108830","messageId":"a4babd41cc6d1e73908209b1917c2123dd2c80fc.1237667830.git.j6t@kdbg.org","threadId":"18451","inReplyTo":"cover.1237667830.git.j6t@kdbg.org","subject":"[PATCH 15/16] t7004: Use prerequisite tags to skip tests that need gpg","fromName":"Johannes Sixt","fromEmail":"j6t@kdbg.org","sentAt":"2009-03-21T21:26:38Z","receivedAt":"2009-03-21T21:26:38Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"The tests are skipped if no gpg was found or if gpg is version 1.0.6.\nPreviously, the latter condition was checked a bit later in the test file\nso that the tag verification tests would be exercised. These are now\nskipped as well, but only because we would need a facility to revoke a\ntest prerequisite, which we do not have.\n\nSigned-off-by: Johannes Sixt <j6t@kdbg.org>\n---\n t/t7004-tag.sh |   97 +++++++++++++++++++++++++++----------------------------\n 1 files changed, 48 insertions(+), 49 deletions(-)\n\ndiff --git a/t/t7004-tag.sh b/t/t7004-tag.sh\nindex 1c27ffb..73dbc43 100755\n--- a/t/t7004-tag.sh\n+++ b/t/t7004-tag.sh\n@@ -581,28 +581,38 @@ test_expect_success \\\n '\n \n # subsequent tests require gpg; check if it is available\n-gpg --version >/dev/null\n+gpg --version >/dev/null 2>/dev/null\n if [ $? -eq 127 ]; then\n \tsay \"gpg not found - skipping tag signing and verification tests\"\n-\ttest_done\n-\texit\n+else\n+\t# As said here: http://www.gnupg.org/documentation/faqs.html#q6.19\n+\t# the gpg version 1.0.6 didn't parse trust packets correctly, so for\n+\t# that version, creation of signed tags using the generated key fails.\n+\tcase \"$(gpg --version)\" in\n+\t'gpg (GnuPG) 1.0.6'*)\n+\t\tsay \"Skipping signed tag tests, because a bug in 1.0.6 version\"\n+\t\t;;\n+\t*)\n+\t\ttest_set_prereq GPG\n+\t\t;;\n+\tesac\n fi\n \n # trying to verify annotated non-signed tags:\n \n-test_expect_success \\\n+test_expect_success GPG \\\n \t'trying to verify an annotated non-signed tag should fail' '\n \ttag_exists annotated-tag &&\n \ttest_must_fail git tag -v annotated-tag\n '\n \n-test_expect_success \\\n+test_expect_success GPG \\\n \t'trying to verify a file-annotated non-signed tag should fail' '\n \ttag_exists file-annotated-tag &&\n \ttest_must_fail git tag -v file-annotated-tag\n '\n \n-test_expect_success \\\n+test_expect_success GPG \\\n \t'trying to verify two annotated non-signed tags should fail' '\n \ttag_exists annotated-tag file-annotated-tag &&\n \ttest_must_fail git tag -v annotated-tag file-annotated-tag\n@@ -610,17 +620,6 @@ test_expect_success \\\n \n # creating and verifying signed tags:\n \n-# As said here: http://www.gnupg.org/documentation/faqs.html#q6.19\n-# the gpg version 1.0.6 didn't parse trust packets correctly, so for\n-# that version, creation of signed tags using the generated key fails.\n-case \"$(gpg --version)\" in\n-'gpg (GnuPG) 1.0.6'*)\n-\tsay \"Skipping signed tag tests, because a bug in 1.0.6 version\"\n-\ttest_done\n-\texit\n-\t;;\n-esac\n-\n # key generation info: gpg --homedir t/t7004 --gen-key\n # Type DSA and Elgamal, size 2048 bits, no expiration date.\n # Name and email: C O Mitter <committer@example.com>\n@@ -634,7 +633,7 @@ export GNUPGHOME\n get_tag_header signed-tag $commit commit $time >expect\n echo 'A signed tag message' >>expect\n echo '-----BEGIN PGP SIGNATURE-----' >>expect\n-test_expect_success 'creating a signed tag with -m message should succeed' '\n+test_expect_success GPG 'creating a signed tag with -m message should succeed' '\n \tgit tag -s -m \"A signed tag message\" signed-tag &&\n \tget_tag_msg signed-tag >actual &&\n \ttest_cmp expect actual\n@@ -643,7 +642,7 @@ test_expect_success 'creating a signed tag with -m message should succeed' '\n get_tag_header u-signed-tag $commit commit $time >expect\n echo 'Another message' >>expect\n echo '-----BEGIN PGP SIGNATURE-----' >>expect\n-test_expect_success 'sign with a given key id' '\n+test_expect_success GPG 'sign with a given key id' '\n \n \tgit tag -u committer@example.com -m \"Another message\" u-signed-tag &&\n \tget_tag_msg u-signed-tag >actual &&\n@@ -651,14 +650,14 @@ test_expect_success 'sign with a given key id' '\n \n '\n \n-test_expect_success 'sign with an unknown id (1)' '\n+test_expect_success GPG 'sign with an unknown id (1)' '\n \n \ttest_must_fail git tag -u author@example.com \\\n \t\t-m \"Another message\" o-signed-tag\n \n '\n \n-test_expect_success 'sign with an unknown id (2)' '\n+test_expect_success GPG 'sign with an unknown id (2)' '\n \n \ttest_must_fail git tag -u DEADBEEF -m \"Another message\" o-signed-tag\n \n@@ -675,7 +674,7 @@ chmod +x fakeeditor\n get_tag_header implied-sign $commit commit $time >expect\n ./fakeeditor >>expect\n echo '-----BEGIN PGP SIGNATURE-----' >>expect\n-test_expect_success '-u implies signed tag' '\n+test_expect_success GPG '-u implies signed tag' '\n \tGIT_EDITOR=./fakeeditor git tag -u CDDE430D implied-sign &&\n \tget_tag_msg implied-sign >actual &&\n \ttest_cmp expect actual\n@@ -688,7 +687,7 @@ EOF\n get_tag_header file-signed-tag $commit commit $time >expect\n cat sigmsgfile >>expect\n echo '-----BEGIN PGP SIGNATURE-----' >>expect\n-test_expect_success \\\n+test_expect_success GPG \\\n \t'creating a signed tag with -F messagefile should succeed' '\n \tgit tag -s -F sigmsgfile file-signed-tag &&\n \tget_tag_msg file-signed-tag >actual &&\n@@ -702,7 +701,7 @@ EOF\n get_tag_header stdin-signed-tag $commit commit $time >expect\n cat siginputmsg >>expect\n echo '-----BEGIN PGP SIGNATURE-----' >>expect\n-test_expect_success 'creating a signed tag with -F - should succeed' '\n+test_expect_success GPG 'creating a signed tag with -F - should succeed' '\n \tgit tag -s -F - stdin-signed-tag <siginputmsg &&\n \tget_tag_msg stdin-signed-tag >actual &&\n \ttest_cmp expect actual\n@@ -711,13 +710,13 @@ test_expect_success 'creating a signed tag with -F - should succeed' '\n get_tag_header implied-annotate $commit commit $time >expect\n ./fakeeditor >>expect\n echo '-----BEGIN PGP SIGNATURE-----' >>expect\n-test_expect_success '-s implies annotated tag' '\n+test_expect_success GPG '-s implies annotated tag' '\n \tGIT_EDITOR=./fakeeditor git tag -s implied-annotate &&\n \tget_tag_msg implied-annotate >actual &&\n \ttest_cmp expect actual\n '\n \n-test_expect_success \\\n+test_expect_success GPG \\\n \t'trying to create a signed tag with non-existing -F file should fail' '\n \t! test -f nonexistingfile &&\n \t! tag_exists nosigtag &&\n@@ -725,13 +724,13 @@ test_expect_success \\\n \t! tag_exists nosigtag\n '\n \n-test_expect_success 'verifying a signed tag should succeed' \\\n+test_expect_success GPG 'verifying a signed tag should succeed' \\\n \t'git tag -v signed-tag'\n \n-test_expect_success 'verifying two signed tags in one command should succeed' \\\n+test_expect_success GPG 'verifying two signed tags in one command should succeed' \\\n \t'git tag -v signed-tag file-signed-tag'\n \n-test_expect_success \\\n+test_expect_success GPG \\\n \t'verifying many signed and non-signed tags should fail' '\n \ttest_must_fail git tag -v signed-tag annotated-tag &&\n \ttest_must_fail git tag -v file-annotated-tag file-signed-tag &&\n@@ -740,7 +739,7 @@ test_expect_success \\\n \ttest_must_fail git tag -v signed-tag annotated-tag file-signed-tag\n '\n \n-test_expect_success 'verifying a forged tag should fail' '\n+test_expect_success GPG 'verifying a forged tag should fail' '\n \tforged=$(git cat-file tag signed-tag |\n \t\tsed -e \"s/signed-tag/forged-tag/\" |\n \t\tgit mktag) &&\n@@ -752,7 +751,7 @@ test_expect_success 'verifying a forged tag should fail' '\n \n get_tag_header empty-signed-tag $commit commit $time >expect\n echo '-----BEGIN PGP SIGNATURE-----' >>expect\n-test_expect_success \\\n+test_expect_success GPG \\\n \t'creating a signed tag with an empty -m message should succeed' '\n \tgit tag -s -m \"\" empty-signed-tag &&\n \tget_tag_msg empty-signed-tag >actual &&\n@@ -763,7 +762,7 @@ test_expect_success \\\n >sigemptyfile\n get_tag_header emptyfile-signed-tag $commit commit $time >expect\n echo '-----BEGIN PGP SIGNATURE-----' >>expect\n-test_expect_success \\\n+test_expect_success GPG \\\n \t'creating a signed tag with an empty -F messagefile should succeed' '\n \tgit tag -s -F sigemptyfile emptyfile-signed-tag &&\n \tget_tag_msg emptyfile-signed-tag >actual &&\n@@ -786,7 +785,7 @@ Trailing spaces\n Trailing blank lines\n EOF\n echo '-----BEGIN PGP SIGNATURE-----' >>expect\n-test_expect_success \\\n+test_expect_success GPG \\\n \t'extra blanks in the message for a signed tag should be removed' '\n \tgit tag -s -F sigblanksfile blanks-signed-tag &&\n \tget_tag_msg blanks-signed-tag >actual &&\n@@ -796,7 +795,7 @@ test_expect_success \\\n \n get_tag_header blank-signed-tag $commit commit $time >expect\n echo '-----BEGIN PGP SIGNATURE-----' >>expect\n-test_expect_success \\\n+test_expect_success GPG \\\n \t'creating a signed tag with a blank -m message should succeed' '\n \tgit tag -s -m \"     \" blank-signed-tag &&\n \tget_tag_msg blank-signed-tag >actual &&\n@@ -809,7 +808,7 @@ echo ''      >>sigblankfile\n echo '  '    >>sigblankfile\n get_tag_header blankfile-signed-tag $commit commit $time >expect\n echo '-----BEGIN PGP SIGNATURE-----' >>expect\n-test_expect_success \\\n+test_expect_success GPG \\\n \t'creating a signed tag with blank -F file with spaces should succeed' '\n \tgit tag -s -F sigblankfile blankfile-signed-tag &&\n \tget_tag_msg blankfile-signed-tag >actual &&\n@@ -820,7 +819,7 @@ test_expect_success \\\n printf '      ' >sigblanknonlfile\n get_tag_header blanknonlfile-signed-tag $commit commit $time >expect\n echo '-----BEGIN PGP SIGNATURE-----' >>expect\n-test_expect_success \\\n+test_expect_success GPG \\\n \t'creating a signed tag with spaces and no newline should succeed' '\n \tgit tag -s -F sigblanknonlfile blanknonlfile-signed-tag &&\n \tget_tag_msg blanknonlfile-signed-tag >actual &&\n@@ -857,7 +856,7 @@ Another line.\n Last line.\n EOF\n echo '-----BEGIN PGP SIGNATURE-----' >>expect\n-test_expect_success \\\n+test_expect_success GPG \\\n \t'creating a signed tag with a -F file with #comments should succeed' '\n \tgit tag -s -F sigcommentsfile comments-signed-tag &&\n \tget_tag_msg comments-signed-tag >actual &&\n@@ -867,7 +866,7 @@ test_expect_success \\\n \n get_tag_header comment-signed-tag $commit commit $time >expect\n echo '-----BEGIN PGP SIGNATURE-----' >>expect\n-test_expect_success \\\n+test_expect_success GPG \\\n \t'creating a signed tag with #commented -m message should succeed' '\n \tgit tag -s -m \"#comment\" comment-signed-tag &&\n \tget_tag_msg comment-signed-tag >actual &&\n@@ -880,7 +879,7 @@ echo ''         >>sigcommentfile\n echo '####'     >>sigcommentfile\n get_tag_header commentfile-signed-tag $commit commit $time >expect\n echo '-----BEGIN PGP SIGNATURE-----' >>expect\n-test_expect_success \\\n+test_expect_success GPG \\\n \t'creating a signed tag with #commented -F messagefile should succeed' '\n \tgit tag -s -F sigcommentfile commentfile-signed-tag &&\n \tget_tag_msg commentfile-signed-tag >actual &&\n@@ -891,7 +890,7 @@ test_expect_success \\\n printf '#comment' >sigcommentnonlfile\n get_tag_header commentnonlfile-signed-tag $commit commit $time >expect\n echo '-----BEGIN PGP SIGNATURE-----' >>expect\n-test_expect_success \\\n+test_expect_success GPG \\\n \t'creating a signed tag with a #comment and no newline should succeed' '\n \tgit tag -s -F sigcommentnonlfile commentnonlfile-signed-tag &&\n \tget_tag_msg commentnonlfile-signed-tag >actual &&\n@@ -901,7 +900,7 @@ test_expect_success \\\n \n # listing messages for signed tags:\n \n-test_expect_success \\\n+test_expect_success GPG \\\n \t'listing the one-line message of a signed tag should succeed' '\n \tgit tag -s -m \"A message line signed\" stag-one-line &&\n \n@@ -926,7 +925,7 @@ test_expect_success \\\n \ttest_cmp expect actual\n '\n \n-test_expect_success \\\n+test_expect_success GPG \\\n \t'listing the zero-lines message of a signed tag should succeed' '\n \tgit tag -s -m \"\" stag-zero-lines &&\n \n@@ -954,7 +953,7 @@ test_expect_success \\\n echo 'stag line one' >sigtagmsg\n echo 'stag line two' >>sigtagmsg\n echo 'stag line three' >>sigtagmsg\n-test_expect_success \\\n+test_expect_success GPG \\\n \t'listing many message lines of a signed tag should succeed' '\n \tgit tag -s -F sigtagmsg stag-lines &&\n \n@@ -999,12 +998,12 @@ test_expect_success \\\n \n tree=$(git rev-parse HEAD^{tree})\n blob=$(git rev-parse HEAD:foo)\n-tag=$(git rev-parse signed-tag)\n+tag=$(git rev-parse signed-tag 2>/dev/null)\n \n get_tag_header tree-signed-tag $tree tree $time >expect\n echo \"A message for a tree\" >>expect\n echo '-----BEGIN PGP SIGNATURE-----' >>expect\n-test_expect_success \\\n+test_expect_success GPG \\\n \t'creating a signed tag pointing to a tree should succeed' '\n \tgit tag -s -m \"A message for a tree\" tree-signed-tag HEAD^{tree} &&\n \tget_tag_msg tree-signed-tag >actual &&\n@@ -1014,7 +1013,7 @@ test_expect_success \\\n get_tag_header blob-signed-tag $blob blob $time >expect\n echo \"A message for a blob\" >>expect\n echo '-----BEGIN PGP SIGNATURE-----' >>expect\n-test_expect_success \\\n+test_expect_success GPG \\\n \t'creating a signed tag pointing to a blob should succeed' '\n \tgit tag -s -m \"A message for a blob\" blob-signed-tag HEAD:foo &&\n \tget_tag_msg blob-signed-tag >actual &&\n@@ -1024,7 +1023,7 @@ test_expect_success \\\n get_tag_header tag-signed-tag $tag tag $time >expect\n echo \"A message for another tag\" >>expect\n echo '-----BEGIN PGP SIGNATURE-----' >>expect\n-test_expect_success \\\n+test_expect_success GPG \\\n \t'creating a signed tag pointing to another tag should succeed' '\n \tgit tag -s -m \"A message for another tag\" tag-signed-tag signed-tag &&\n \tget_tag_msg tag-signed-tag >actual &&\n@@ -1033,7 +1032,7 @@ test_expect_success \\\n \n # try to sign with bad user.signingkey\n git config user.signingkey BobTheMouse\n-test_expect_success \\\n+test_expect_success GPG \\\n \t'git tag -s fails if gpg is misconfigured' \\\n \t'test_must_fail git tag -s -m tail tag-gpg-failure'\n git config --unset user.signingkey\n@@ -1041,7 +1040,7 @@ git config --unset user.signingkey\n # try to verify without gpg:\n \n rm -rf gpghome\n-test_expect_success \\\n+test_expect_success GPG \\\n \t'verify signed tag fails when public key is not present' \\\n \t'test_must_fail git tag -v signed-tag'\n \n-- \n1.6.2.1.224.g2225f\n"},{"id":"108828","messageId":"4e60515a24ab4197d24c62408a277e76c65cde62.1237667830.git.j6t@kdbg.org","threadId":"18451","inReplyTo":"cover.1237667830.git.j6t@kdbg.org","subject":"[PATCH 16/16] t5503: GIT_DEBUG_SEND_PACK is not supported on MinGW","fromName":"Johannes Sixt","fromEmail":"j6t@kdbg.org","sentAt":"2009-03-21T21:26:39Z","receivedAt":"2009-03-21T21:26:39Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"The test opens fd 3 and instructs git-upload-pack (via GIT_DEBUG_SEND_PACK)\nto log information to that channel.\n\nThe way in which new processes are spawned by git on MinGW does not inherit\nall file descriptors to the child processes, but only 0, 1, and 2.\nThe tests in t5503 require that file descriptor 3 is inherited from\ngit-fetch to git-upload-pack.\n\nA complete implementation is non-trivial and not warranted just to satisfy\nthis test.  Note that the incompleteness applies only to the executables\nthat use compat/mingw.c; bash and perl (the other important executables\nused by git) are complete, of course.\n\nSigned-off-by: Johannes Sixt <j6t@kdbg.org>\n---\n t/t5503-tagfollow.sh |    7 +++++++\n 1 files changed, 7 insertions(+), 0 deletions(-)\n\ndiff --git a/t/t5503-tagfollow.sh b/t/t5503-tagfollow.sh\nindex 4074e23..e75ccbc 100755\n--- a/t/t5503-tagfollow.sh\n+++ b/t/t5503-tagfollow.sh\n@@ -4,6 +4,13 @@ test_description='test automatic tag following'\n \n . ./test-lib.sh\n \n+case $(uname -s) in\n+*MINGW*)\n+\tsay \"GIT_DEBUG_SEND_PACK not supported - skipping tests\"\n+\ttest_done\n+\texit\n+esac\n+\n # End state of the repository:\n #\n #         T - tag1          S - tag2\n-- \n1.6.2.1.224.g2225f\n"},{"id":"108831","messageId":"200903212241.57957.j6t@kdbg.org","threadId":"18451","inReplyTo":"cover.1237667830.git.j6t@kdbg.org","subject":"Re: [PATCH 00/16] Tests on Windows - main part","fromName":"Johannes Sixt","fromEmail":"j6t@kdbg.org","sentAt":"2009-03-21T21:41:57Z","receivedAt":"2009-03-21T21:41:57Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"On Samstag, 21. März 2009, Johannes Sixt wrote:\n> This is the remaining set of changes after which the test suite\n> passes with the MinGW port. Well, almost: There still are a few\n> failures, but none of them indicate a serious bug. We will address\n> them later.\n\nFWIW, the tests that still fail are:\n\n# git am does not treat absolute path to mbox file correctly\nGIT_SKIP_TESTS += t4150.18\n# git am hangs for some not yet know reason\nGIT_SKIP_TESTS += t4252.7\n# git upload-pack does not write an error message in this case\n# (reason unknown; seems to be a race condition)\nGIT_SKIP_TESTS += t5530.6\n# vim should terminate if its stdin is not a terminal, but it doesn't\n# (at least that's what I noted down when I last investigated the issue ;)\nGIT_SKIP_TESTS += t7005\n# output contains CRLF (I think)\nGIT_SKIP_TESTS += t7401.14\n# SIGTERM is not sent or not caught - doesn't work with SIGINT, either\nGIT_SKIP_TESTS += t7502.18\n# output contains CRLF (I think)\nGIT_SKIP_TESTS += t7508.1[68]\n# perl scripts don't work in test mode\nGIT_SKIP_TESTS += t9001 t9200 t9500\n\nand all 'git svn' tests: t91??-*.sh\n\n-- Hannes\n"},{"id":"108847","messageId":"7v3ad6cvub.fsf@gitster.siamese.dyndns.org","threadId":"18451","inReplyTo":"6acd113f60d1b0e7926386f3aebe5d72ad362034.1237667830.git.j6t@kdbg.org","subject":"Re: [PATCH 13/16] t3700: Skip a test with backslashes in pathspec","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-03-21T23:14:20Z","receivedAt":"2009-03-21T23:14:20Z","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> Signed-off-by: Johannes Sixt <j6t@kdbg.org>\n> ---\n>  t/t3700-add.sh |    2 +-\n>  t/test-lib.sh  |    2 ++\n>  2 files changed, 3 insertions(+), 1 deletions(-)\n>\n> diff --git a/t/t3700-add.sh b/t/t3700-add.sh\n> index dc17d9f..050de42 100755\n> --- a/t/t3700-add.sh\n> +++ b/t/t3700-add.sh\n> @@ -222,7 +222,7 @@ test_expect_success POSIXPERM 'git add (add.ignore-errors = false)' '\n>  \t! ( git ls-files foo1 | grep foo1 )\n>  '\n>  \n> -test_expect_success 'git add '\\''fo\\[ou\\]bar'\\'' ignores foobar' '\n> +test_expect_success BSLASHPSPEC \"git add 'fo\\\\[ou\\\\]bar' ignores foobar\" '\n>  \tgit reset --hard &&\n>  \ttouch fo\\[ou\\]bar foobar &&\n>  \tgit add '\\''fo\\[ou\\]bar'\\'' &&\n\nI do not think the justification for this change is explained well enough.\n\nThe test prepares a file whose name consists of \"ef, oh, bra, oh, you,\nket, bee, ei and are\" (no backslashes), and passes a filespec that quotes\nbra and ket with backslash so glob won't misinterpret as if we are asking\nto add \"ef oh followed by either oh or you followed by bee ei are\".  There\nis no path that has a backslash in it involved.\n\nIf this does not work on Windows, there is something else going on.  Is it\nthat the shell eats one level of backslash too much or something?\n"},{"id":"108849","messageId":"7vr60qbh8c.fsf@gitster.siamese.dyndns.org","threadId":"18451","inReplyTo":"70f789fecee6955c362391b33272223c7ba74cc6.1237667830.git.j6t@kdbg.org","subject":"Re: [PATCH 06/16] t3600: Use test prerequisite tags","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-03-21T23:15:15Z","receivedAt":"2009-03-21T23:15:15Z","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> The are two prerequisites.\n\nTypo?\n\n>\n> - The filesystem support names with tabs or new-lines.\n>\n> - Files cannot be removed if their containing directory is read-only.\n>\n> Previously, whether these preconditions are satisified was tested inside\n> test_expect_success. We move these tests outside because, strictly\n> speaking, they are not part of the tests.\n\nOtherwise looks good; thanks.\n"},{"id":"108850","messageId":"7vmybebh5v.fsf@gitster.siamese.dyndns.org","threadId":"18451","inReplyTo":"a7bb394037e1c32d47d0b04da025bdbe2eb78d66.1237667830.git.j6t@kdbg.org","subject":"Re: [PATCH 05/16] test-lib: Infrastructure to test and check for prerequisites","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-03-21T23:16:44Z","receivedAt":"2009-03-21T23:16:44Z","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> Some tests can be run only if a particular prerequisite is available. For\n> example, some tests require that an UTF-8 locale is available. Here we\n> introduce functions that are used in this way:\n>\n> 1. Insert code that checks whether the prerequisite is available. If it is,\n>    call test_set_prereq with an arbitrary tag name that subsequently can be\n>    used to check for the prerequisite:\n>\n>       case $LANG in\n>       *.utf-8)\n>             test_set_prereq UTF8\n>             ;;\n>       esac\n>\n> 2. In the calls to test_expect_success pass the tag name:\n>\n>       test_expect_success UTF8 '...description...' '...tests...'\n>\n> 3. There is an auxiliary predicate that can be used anywhere to test for\n>    a prerequisite explicitly:\n>\n>       if test_have_prereq UTF8\n>       then\n>             ...code to be skipped if prerequisite is not available...\n>       fi\n>\n> Signed-off-by: Johannes Sixt <j6t@kdbg.org>\n\nVery nicely done.  Thanks.\n"},{"id":"108909","messageId":"200903221755.44642.j6t@kdbg.org","threadId":"18451","inReplyTo":"7v3ad6cvub.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH 13/16] t3700: Skip a test with backslashes in pathspec","fromName":"Johannes Sixt","fromEmail":"j6t@kdbg.org","sentAt":"2009-03-22T16:55:44Z","receivedAt":"2009-03-22T16:55:44Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"On Sonntag, 22. März 2009, Junio C Hamano wrote:\n> I do not think the justification for this change is explained well enough.\n>\n> The test prepares a file whose name consists of \"ef, oh, bra, oh, you,\n> ket, bee, ei and are\" (no backslashes), and passes a filespec that quotes\n> bra and ket with backslash so glob won't misinterpret as if we are asking\n> to add \"ef oh followed by either oh or you followed by bee ei are\".  There\n> is no path that has a backslash in it involved.\n>\n> If this does not work on Windows, there is something else going on.  Is it\n> that the shell eats one level of backslash too much or something?\n\nI added these two paragraphs:\n\nThe test verifies that glob special characters can be escaped with\nbackslashes.  In particular, the string fo\\[ou\\]bar is given to git.\n\nOn Windows, this does not work because backslashes are first of all\ndirectory separators, and first thing git does with a pathspec from the\ncommand line is to convert backslashes to forward slashes.\n\n-- Hannes\n"},{"id":"108935","messageId":"7vr60pcj89.fsf@gitster.siamese.dyndns.org","threadId":"18451","inReplyTo":"200903221755.44642.j6t@kdbg.org","subject":"Re: [PATCH 13/16] t3700: Skip a test with backslashes in pathspec","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-03-22T21:59:02Z","receivedAt":"2009-03-22T21:59:02Z","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> On Sonntag, 22. März 2009, Junio C Hamano wrote:\n>> I do not think the justification for this change is explained well enough.\n>>\n>> The test prepares a file whose name consists of \"ef, oh, bra, oh, you,\n>> ket, bee, ei and are\" (no backslashes), and passes a filespec that quotes\n>> bra and ket with backslash so glob won't misinterpret as if we are asking\n>> to add \"ef oh followed by either oh or you followed by bee ei are\".  There\n>> is no path that has a backslash in it involved.\n>>\n>> If this does not work on Windows, there is something else going on.  Is it\n>> that the shell eats one level of backslash too much or something?\n>\n> I added these two paragraphs:\n\nThanks; pulled.\n"}]}