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: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Elijah Newren 2010-10-03 14:00:03 -06:00 committed by Junio C Hamano
parent 315e76540b
commit b62b3436ff

View File

@ -205,8 +205,8 @@ test_expect_success \
'rm -fr Z [A-Z][A-Z] && 'rm -fr Z [A-Z][A-Z] &&
git read-tree $tree_A && git read-tree $tree_A &&
git checkout-index -f -a && git checkout-index -f -a &&
git read-tree --reset $tree_O || return 1 git read-tree --reset $tree_O &&
git update-index --refresh >/dev/null ;# this can exit non-zero test_must_fail git update-index --refresh -q &&
git diff-files >.test-a && git diff-files >.test-a &&
cmp_diff_files_output .test-a .test-recursive-OA' cmp_diff_files_output .test-a .test-recursive-OA'
@ -215,8 +215,8 @@ test_expect_success \
'rm -fr Z [A-Z][A-Z] && 'rm -fr Z [A-Z][A-Z] &&
git read-tree $tree_B && git read-tree $tree_B &&
git checkout-index -f -a && git checkout-index -f -a &&
git read-tree --reset $tree_O || return 1 git read-tree --reset $tree_O &&
git update-index --refresh >/dev/null ;# this can exit non-zero test_must_fail git update-index --refresh -q &&
git diff-files >.test-a && git diff-files >.test-a &&
cmp_diff_files_output .test-a .test-recursive-OB' cmp_diff_files_output .test-a .test-recursive-OB'
@ -225,8 +225,8 @@ test_expect_success \
'rm -fr Z [A-Z][A-Z] && 'rm -fr Z [A-Z][A-Z] &&
git read-tree $tree_B && git read-tree $tree_B &&
git checkout-index -f -a && git checkout-index -f -a &&
git read-tree --reset $tree_A || return 1 git read-tree --reset $tree_A &&
git update-index --refresh >/dev/null ;# this can exit non-zero test_must_fail git update-index --refresh -q &&
git diff-files >.test-a && git diff-files >.test-a &&
cmp_diff_files_output .test-a .test-recursive-AB' cmp_diff_files_output .test-a .test-recursive-AB'