File tree Expand file tree Collapse file tree 2 files changed +13
-9
lines changed Expand file tree Collapse file tree 2 files changed +13
-9
lines changed Original file line number Diff line number Diff line change @@ -147,7 +147,7 @@ test_commit_autosquash_flags () {
147
147
git commit -a -m "intermediate commit" &&
148
148
test_tick &&
149
149
echo $H $flag >>F &&
150
- git commit -a --$flag HEAD~1 $3 &&
150
+ git commit -a --$flag HEAD~1 &&
151
151
E=$(git cat-file commit ' $H -$flag ' |
152
152
sed -ne "s/^encoding //p") &&
153
153
test "z$E" = "z$H" &&
@@ -160,6 +160,6 @@ test_commit_autosquash_flags () {
160
160
161
161
test_commit_autosquash_flags eucJP fixup
162
162
163
- test_commit_autosquash_flags ISO-2022-JP squash ' -m "squash message" '
163
+ test_commit_autosquash_flags ISO-2022-JP squash
164
164
165
165
test_done
Original file line number Diff line number Diff line change @@ -444,20 +444,26 @@ test_debug () {
444
444
test " $debug " = " " || eval " $1 "
445
445
}
446
446
447
+ test_eval_ () {
448
+ # This is a separate function because some tests use
449
+ # "return" to end a test_expect_success block early.
450
+ eval >&3 2>&4 " $* "
451
+ }
452
+
447
453
test_run_ () {
448
454
test_cleanup=:
449
455
expecting_failure=$2
450
- eval >&3 2>&4 " $1 "
456
+ test_eval_ " $1 "
451
457
eval_ret=$?
452
458
453
459
if test -z " $immediate " || test $eval_ret = 0 || test -n " $expecting_failure "
454
460
then
455
- eval >&3 2>&4 " $test_cleanup "
461
+ test_eval_ " $test_cleanup "
456
462
fi
457
463
if test " $verbose " = " t" && test -n " $HARNESS_ACTIVE " ; then
458
464
echo " "
459
465
fi
460
- return 0
466
+ return " $eval_ret "
461
467
}
462
468
463
469
test_skip () {
@@ -502,8 +508,7 @@ test_expect_failure () {
502
508
if ! test_skip " $@ "
503
509
then
504
510
say >&3 " checking known breakage: $2 "
505
- test_run_ " $2 " expecting_failure
506
- if [ " $? " = 0 -a " $eval_ret " = 0 ]
511
+ if test_run_ " $2 " expecting_failure
507
512
then
508
513
test_known_broken_ok_ " $1 "
509
514
else
@@ -521,8 +526,7 @@ test_expect_success () {
521
526
if ! test_skip " $@ "
522
527
then
523
528
say >&3 " expecting success: $2 "
524
- test_run_ " $2 "
525
- if [ " $? " = 0 -a " $eval_ret " = 0 ]
529
+ if test_run_ " $2 "
526
530
then
527
531
test_ok_ " $1 "
528
532
else
You can’t perform that action at this time.
0 commit comments