Christian Couder <christian.cou...@gmail.com> writes:

> +/*
> + * Try to apply a patch.
> + *
> + * Returns:
> + *  -1 if an error happened
> + *   0 if the patch applied
> + *   1 if the patch did not apply
> + */
>  static int apply_patch(struct apply_state *state,
>                      int fd,
>                      const char *filename,
> @@ -4413,6 +4421,7 @@ static int apply_patch(struct apply_state *state,
>       struct strbuf buf = STRBUF_INIT; /* owns the patch text */
>       struct patch *list = NULL, **listp = &list;
>       int skipped_patch = 0;
> +     int res = 0;
>  
>       state->patch_input_file = filename;
>       read_patch_file(&buf, fd);
> @@ -4445,8 +4454,10 @@ static int apply_patch(struct apply_state *state,
>               offset += nr;
>       }
>  
> -     if (!list && !skipped_patch)
> -             die(_("unrecognized input"));
> +     if (!list && !skipped_patch) {
> +             res = error(_("unrecognized input"));
> +             goto end;
> +     }

Before this patch, the program said "fatal: $message" and exited
with status = 128.  All these changes in this step modifies the
external behaviour and make it say "error: $message" and exit with
status = 1 (at least the caller in apply_all_patches() does so).

Will that be an issue for the calling scripts?

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to