Commit dbf1b5f
builtin/apply: make gitdiff_*() return -1 on error
To libify `git apply` functionality we have to signal errors to the
caller instead of die()ing.
To do that in a compatible manner with the rest of the error handling
in "builtin/apply.c", gitdiff_*() functions should return -1 instead
of calling die().
A previous patch made it possible for gitdiff_*() functions to
return -1 in case of error. Let's take advantage of that to
make gitdiff_verify_name() return -1 on error, and to have
gitdiff_oldname() and gitdiff_newname() directly return
what gitdiff_verify_name() returns.
Helped-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>1 parent 70af766 commit dbf1b5f
1 file changed
+21
-19
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
827 | 827 | | |
828 | 828 | | |
829 | 829 | | |
830 | | - | |
831 | | - | |
832 | | - | |
833 | | - | |
834 | | - | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
835 | 835 | | |
836 | 836 | | |
837 | 837 | | |
838 | | - | |
| 838 | + | |
839 | 839 | | |
840 | 840 | | |
841 | 841 | | |
842 | 842 | | |
843 | 843 | | |
844 | 844 | | |
845 | | - | |
846 | | - | |
| 845 | + | |
| 846 | + | |
847 | 847 | | |
848 | | - | |
849 | | - | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
850 | 851 | | |
851 | 852 | | |
| 853 | + | |
852 | 854 | | |
853 | 855 | | |
854 | 856 | | |
855 | 857 | | |
856 | | - | |
| 858 | + | |
857 | 859 | | |
| 860 | + | |
| 861 | + | |
858 | 862 | | |
859 | 863 | | |
860 | 864 | | |
861 | 865 | | |
862 | 866 | | |
863 | 867 | | |
864 | | - | |
865 | | - | |
866 | | - | |
867 | | - | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
868 | 871 | | |
869 | 872 | | |
870 | 873 | | |
871 | 874 | | |
872 | 875 | | |
873 | 876 | | |
874 | | - | |
875 | | - | |
876 | | - | |
877 | | - | |
| 877 | + | |
| 878 | + | |
| 879 | + | |
878 | 880 | | |
879 | 881 | | |
880 | 882 | | |
| |||
0 commit comments