mirror of
https://github.com/git/git
synced 2024-08-27 11:39:22 +00:00
t1002: modernize outdated conditional
Tests in this script use an unusual and hard to reason about conditional construct if expression; then false; else :; fi Change them to use more idiomatic construct: ! expression Cc: Christian Couder <christian.couder@gmail.com> Cc: Hariom Verma <hariom18599@gmail.com> Signed-off-by: Nsengiyumva Wilberforce <nsengiyumvawilberforce@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
3dcec76d9d
commit
8d2863e4ed
|
@ -154,7 +154,7 @@ test_expect_success \
|
|||
read_tree_u_must_succeed --reset -u $treeH &&
|
||||
echo frotz frotz >frotz &&
|
||||
git update-index --add frotz &&
|
||||
if read_tree_u_must_succeed -m -u $treeH $treeM; then false; else :; fi'
|
||||
! read_tree_u_must_succeed -m -u $treeH $treeM'
|
||||
|
||||
test_expect_success \
|
||||
'9 - conflicting addition.' \
|
||||
|
@ -163,7 +163,7 @@ test_expect_success \
|
|||
echo frotz frotz >frotz &&
|
||||
git update-index --add frotz &&
|
||||
echo frotz >frotz &&
|
||||
if read_tree_u_must_succeed -m -u $treeH $treeM; then false; else :; fi'
|
||||
! read_tree_u_must_succeed -m -u $treeH $treeM'
|
||||
|
||||
test_expect_success \
|
||||
'10 - path removed.' \
|
||||
|
@ -186,7 +186,7 @@ test_expect_success \
|
|||
echo rezrov >rezrov &&
|
||||
git update-index --add rezrov &&
|
||||
echo rezrov rezrov >rezrov &&
|
||||
if read_tree_u_must_succeed -m -u $treeH $treeM; then false; else :; fi'
|
||||
! read_tree_u_must_succeed -m -u $treeH $treeM'
|
||||
|
||||
test_expect_success \
|
||||
'12 - unmatching local changes being removed.' \
|
||||
|
@ -194,7 +194,7 @@ test_expect_success \
|
|||
read_tree_u_must_succeed --reset -u $treeH &&
|
||||
echo rezrov rezrov >rezrov &&
|
||||
git update-index --add rezrov &&
|
||||
if read_tree_u_must_succeed -m -u $treeH $treeM; then false; else :; fi'
|
||||
! read_tree_u_must_succeed -m -u $treeH $treeM'
|
||||
|
||||
test_expect_success \
|
||||
'13 - unmatching local changes being removed.' \
|
||||
|
@ -203,7 +203,7 @@ test_expect_success \
|
|||
echo rezrov rezrov >rezrov &&
|
||||
git update-index --add rezrov &&
|
||||
echo rezrov >rezrov &&
|
||||
if read_tree_u_must_succeed -m -u $treeH $treeM; then false; else :; fi'
|
||||
! read_tree_u_must_succeed -m -u $treeH $treeM'
|
||||
|
||||
cat >expected <<EOF
|
||||
-100644 X 0 nitfol
|
||||
|
@ -251,7 +251,7 @@ test_expect_success \
|
|||
read_tree_u_must_succeed --reset -u $treeH &&
|
||||
echo bozbar bozbar >bozbar &&
|
||||
git update-index --add bozbar &&
|
||||
if read_tree_u_must_succeed -m -u $treeH $treeM; then false; else :; fi'
|
||||
! read_tree_u_must_succeed -m -u $treeH $treeM'
|
||||
|
||||
test_expect_success \
|
||||
'17 - conflicting local change.' \
|
||||
|
@ -260,7 +260,7 @@ test_expect_success \
|
|||
echo bozbar bozbar >bozbar &&
|
||||
git update-index --add bozbar &&
|
||||
echo bozbar bozbar bozbar >bozbar &&
|
||||
if read_tree_u_must_succeed -m -u $treeH $treeM; then false; else :; fi'
|
||||
! read_tree_u_must_succeed -m -u $treeH $treeM'
|
||||
|
||||
test_expect_success \
|
||||
'18 - local change already having a good result.' \
|
||||
|
@ -316,7 +316,7 @@ test_expect_success \
|
|||
echo bozbar >bozbar &&
|
||||
git update-index --add bozbar &&
|
||||
echo gnusto gnusto >bozbar &&
|
||||
if read_tree_u_must_succeed -m -u $treeH $treeM; then false; else :; fi'
|
||||
! read_tree_u_must_succeed -m -u $treeH $treeM'
|
||||
|
||||
# Also make sure we did not break DF vs DF/DF case.
|
||||
test_expect_success \
|
||||
|
|
Loading…
Reference in a new issue