Commit b654b34
builtin/apply: make parse_chunk() return a negative integer on error
To libify `git apply` functionality we have to signal errors to the
caller instead of die()ing or exit()ing.
To do that in a compatible manner with the rest of the error handling
in builtin/apply.c, parse_chunk() should return a negative integer
instead of calling die() or exit().
As parse_chunk() is called only by apply_patch() which already
returns either -1 or -128 when an error happened, let's make it also
return -1 or -128.
This makes it compatible with what find_header() and parse_binary()
already return.
Helped-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>1 parent 5950851 commit b654b34
1 file changed
+14
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1996 | 1996 | | |
1997 | 1997 | | |
1998 | 1998 | | |
1999 | | - | |
2000 | 1999 | | |
2001 | 2000 | | |
2002 | 2001 | | |
2003 | 2002 | | |
2004 | | - | |
2005 | | - | |
| 2003 | + | |
| 2004 | + | |
| 2005 | + | |
| 2006 | + | |
| 2007 | + | |
| 2008 | + | |
2006 | 2009 | | |
2007 | 2010 | | |
2008 | 2011 | | |
2009 | 2012 | | |
2010 | 2013 | | |
2011 | 2014 | | |
2012 | | - | |
2013 | | - | |
2014 | | - | |
2015 | 2015 | | |
2016 | 2016 | | |
2017 | 2017 | | |
| |||
2071 | 2071 | | |
2072 | 2072 | | |
2073 | 2073 | | |
2074 | | - | |
2075 | | - | |
| 2074 | + | |
| 2075 | + | |
| 2076 | + | |
| 2077 | + | |
2076 | 2078 | | |
2077 | 2079 | | |
2078 | 2080 | | |
| |||
4455 | 4457 | | |
4456 | 4458 | | |
4457 | 4459 | | |
| 4460 | + | |
| 4461 | + | |
| 4462 | + | |
| 4463 | + | |
4458 | 4464 | | |
4459 | 4465 | | |
4460 | 4466 | | |
| |||
0 commit comments