Commit 545871b
t9001: use test_when_finished
The confirmation tests in t9001 all save the value of
sendemail.confirm, do something to it, then restore it at
the end, in a way that breaks the &&-chain (they are not
wrong, because they save the $? value, but it fools
--chain-lint).
Instead, they can all use test_when_finished, and we can
even make the code simpler by factoring out the shared
lines.
Note that we can _almost_ use test_config here, except that:
1. We do not restore the config with test_unconfig, but by
setting it back to some prior value.
2. We are not always setting a config variable. Sometimes
the change to be undone is unsetting it entirely.
We could teach test_config to handle these cases, but it's
not worth the complexity for a single call-site.
Signed-off-by: Jeff King <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>1 parent e7d053d commit 545871b
1 file changed
+10
-20
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
817 | 817 | | |
818 | 818 | | |
819 | 819 | | |
820 | | - | |
| 820 | + | |
821 | 821 | | |
| 822 | + | |
| 823 | + | |
| 824 | + | |
| 825 | + | |
| 826 | + | |
822 | 827 | | |
823 | 828 | | |
824 | | - | |
825 | | - | |
826 | | - | |
827 | 829 | | |
828 | 830 | | |
829 | 831 | | |
830 | | - | |
| 832 | + | |
831 | 833 | | |
832 | 834 | | |
833 | | - | |
834 | | - | |
835 | | - | |
836 | 835 | | |
837 | 836 | | |
838 | 837 | | |
839 | | - | |
| 838 | + | |
840 | 839 | | |
841 | 840 | | |
842 | 841 | | |
| |||
846 | 845 | | |
847 | 846 | | |
848 | 847 | | |
849 | | - | |
850 | | - | |
851 | | - | |
852 | 848 | | |
853 | 849 | | |
854 | 850 | | |
855 | | - | |
| 851 | + | |
856 | 852 | | |
857 | 853 | | |
858 | 854 | | |
| |||
861 | 857 | | |
862 | 858 | | |
863 | 859 | | |
864 | | - | |
865 | | - | |
866 | | - | |
867 | 860 | | |
868 | 861 | | |
869 | 862 | | |
870 | | - | |
| 863 | + | |
871 | 864 | | |
872 | 865 | | |
873 | 866 | | |
| |||
876 | 869 | | |
877 | 870 | | |
878 | 871 | | |
879 | | - | |
880 | | - | |
881 | | - | |
882 | 872 | | |
883 | 873 | | |
884 | 874 | | |
| |||
0 commit comments