Skip to content

Commit

Permalink
t4002 (diff-basic): use test_might_fail for commands that might fail
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Elijah Newren authored and Junio C Hamano committed Oct 6, 2010
1 parent 315e765 commit b62b343
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions t/t4002-diff-basic.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand All @@ -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'

Expand All @@ -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'

Expand Down

0 comments on commit b62b343

Please sign in to comment.