Commit cdd4dc2
bisect: libify
Since we want to get rid of git-bisect.sh, it would be necessary to
convert those exit() calls to return statements so that errors can be
reported.
Emulate try catch in C by converting `exit(<positive-value>)` to
`return <negative-value>`. Follow POSIX conventions to return
<negative-value> to indicate error.
In `check_merge_bases()` there is an early success special case,
so we have introduced special error code
BISECT_INTERNAL_SUCCESS_MERGE_BASE (-11) which indicates early
success. This BISECT_INTERNAL_SUCCESS_MERGE_BASE is converted back
to BISECT_OK (0) in `check_good_are_ancestors_of_bad()`.
Update all callers to handle the error returns.
Mentored-by: Christian Couder <chriscool@tuxfamily.org>
Mentored by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Pranit Bauva <pranit.bauva@gmail.com>
Signed-off-by: Tanushree Tumane <tanushreetumane@gmail.com>
Signed-off-by: Miriam Rubio <mirucam@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>check_merge_bases and its dependents1 parent e8e3ce6 commit cdd4dc2
2 files changed
+24
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
811 | 811 | | |
812 | 812 | | |
813 | 813 | | |
814 | | - | |
| 814 | + | |
815 | 815 | | |
816 | 816 | | |
817 | 817 | | |
| 818 | + | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
818 | 822 | | |
819 | | - | |
| 823 | + | |
820 | 824 | | |
| 825 | + | |
821 | 826 | | |
822 | 827 | | |
823 | 828 | | |
| |||
832 | 837 | | |
833 | 838 | | |
834 | 839 | | |
835 | | - | |
| 840 | + | |
| 841 | + | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
836 | 845 | | |
837 | 846 | | |
838 | 847 | | |
839 | 848 | | |
| 849 | + | |
840 | 850 | | |
841 | 851 | | |
842 | 852 | | |
| |||
871 | 881 | | |
872 | 882 | | |
873 | 883 | | |
| 884 | + | |
874 | 885 | | |
875 | 886 | | |
876 | 887 | | |
| |||
885 | 896 | | |
886 | 897 | | |
887 | 898 | | |
| 899 | + | |
888 | 900 | | |
889 | 901 | | |
890 | | - | |
| 902 | + | |
891 | 903 | | |
| 904 | + | |
| 905 | + | |
892 | 906 | | |
893 | 907 | | |
894 | 908 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
42 | 46 | | |
43 | 47 | | |
44 | 48 | | |
45 | 49 | | |
46 | | - | |
| 50 | + | |
| 51 | + | |
47 | 52 | | |
48 | 53 | | |
49 | 54 | | |
| |||
0 commit comments