[PATCH 07/11] t2100: use test_ln_s_add to remove SYMLINKS prerequisite
- From
Johannes Sixt <j6t@kdbg.org>
- Date
- Jun 1, 2013, 09:34 UTC
- Message-ID
- <e232ae3efc6f7b282d4402e6e6976b34d34ab3e7.1370076477.git.j6t@kdbg.org>
- In-Reply-To
- <cover.1370076477.git.j6t@kdbg.org>
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 <j6t@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