提交 b62b3436 编写于 作者: E Elijah Newren 提交者: Junio C Hamano

t4002 (diff-basic): use test_might_fail for commands that might fail

Also replace '|| return 1' by '&&' to allow chain of operations to be
checked for proper return status, and modify the update-index command
as suggested by Jonathan Nieder to not exit early but try to make sure
files that match the work tree are marked as matching.
Acked-by: NÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Reviewed-by: NJonathan Nieder <jrnieder@gmail.com>
Signed-off-by: NElijah Newren <newren@gmail.com>
Signed-off-by: NJunio C Hamano <gitster@pobox.com>
上级 315e7654
......@@ -205,8 +205,8 @@ test_expect_success \
'rm -fr Z [A-Z][A-Z] &&
git read-tree $tree_A &&
git checkout-index -f -a &&
git read-tree --reset $tree_O || return 1
git update-index --refresh >/dev/null ;# this can exit non-zero
git read-tree --reset $tree_O &&
test_must_fail git update-index --refresh -q &&
git diff-files >.test-a &&
cmp_diff_files_output .test-a .test-recursive-OA'
......@@ -215,8 +215,8 @@ test_expect_success \
'rm -fr Z [A-Z][A-Z] &&
git read-tree $tree_B &&
git checkout-index -f -a &&
git read-tree --reset $tree_O || return 1
git update-index --refresh >/dev/null ;# this can exit non-zero
git read-tree --reset $tree_O &&
test_must_fail git update-index --refresh -q &&
git diff-files >.test-a &&
cmp_diff_files_output .test-a .test-recursive-OB'
......@@ -225,8 +225,8 @@ test_expect_success \
'rm -fr Z [A-Z][A-Z] &&
git read-tree $tree_B &&
git checkout-index -f -a &&
git read-tree --reset $tree_A || return 1
git update-index --refresh >/dev/null ;# this can exit non-zero
git read-tree --reset $tree_A &&
test_must_fail git update-index --refresh -q &&
git diff-files >.test-a &&
cmp_diff_files_output .test-a .test-recursive-AB'
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册