Commit c3077ea0 by Edward Thomson

apply: return a specific exit code on failure

Return `GIT_EAPPLYFAIL` on patch application failure so that users can
determine that patch application failed due to a malformed/conflicting
patch by looking at the error code.
parent 973bf0c8
......@@ -57,6 +57,7 @@ typedef enum {
GIT_RETRY = -32, /**< Internal only */
GIT_EMISMATCH = -33, /**< Hashsum mismatch in object */
GIT_EINDEXDIRTY = -34, /**< Unsaved changes in the index would be overwritten */
GIT_EAPPLYFAIL = -35, /**< Patch application failed */
} git_error_code;
/**
......
......@@ -24,7 +24,7 @@
#include "reader.h"
#define apply_err(...) \
( giterr_set(GITERR_PATCH, __VA_ARGS__), -1 )
( giterr_set(GITERR_PATCH, __VA_ARGS__), GIT_EAPPLYFAIL )
typedef struct {
/* The lines that we allocate ourself are allocated out of the pool.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment