One converted case expects 'git update-index' to fail. We cannot use
'test_must_fail test_ln_s_add ...', because that would mistakenly pass
if a command other than the final git-update-index of test_ln_s_add
failed. Hence, use test_ln_s to create the symbolic link and keep
the explicit 'test_must_fail git update-index'.

Signed-off-by: Johannes Sixt <j...@kdbg.org>
---
 t/t2100-update-cache-badpath.sh | 14 ++------------
 1 file changed, 2 insertions(+), 12 deletions(-)

diff --git a/t/t2100-update-cache-badpath.sh b/t/t2100-update-cache-badpath.sh
index a3f9255..47a9b05 100755
--- a/t/t2100-update-cache-badpath.sh
+++ b/t/t2100-update-cache-badpath.sh
@@ -28,12 +28,7 @@ test_expect_success 'git update-index --add to add various 
paths' '
 
        mkdir path2 path3 &&
        date >path0 &&
-       if test_have_prereq SYMLINKS
-       then
-               ln -s xyzzy path1
-       else
-               date >path1
-       fi &&
+       test_ln_s_add xyzzy path1 &&
        date >path2/file2 &&
        date >path3/file3 &&
        test_when_finished "rm -fr path0 path1 path2 path3" &&
@@ -62,12 +57,7 @@ test_expect_success 'git update-index to add conflicting 
file path2 should fail'
 
 test_expect_success 'git update-index to add conflicting symlink path3 should 
fail' '
 
-       if test_have_prereq SYMLINKS
-       then
-               ln -s xyzzy path3
-       else
-               date >path3
-       fi &&
+       test_ln_s xyzzy path3 &&
        test_must_fail git update-index --add -- path3
 '
 
-- 
1.8.3.rc1.32.g8b61cbb

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to