Re: [PATCH v7 00/40] libify apply and use lib in am, part 2
- From
Christian Couder <christian.couder@gmail.com>
- Date
- Jun 13, 2016, 16:16 UTC
- Message-ID
- <CAP8UFD3GgG6geKrXHMKFk-F5inA569DBDjVekNKaDgr5XYaMDw@mail.gmail.com>
- In-Reply-To
- <20160613160942.1806-1-chriscool@tuxfamily.org>
On Mon, Jun 13, 2016 at 6:09 PM, Christian Couder <christian.couder@gmail.com> wrote:
> > I will send a diff between this version and the previous one, as a > reply to this email.
Here is the diff:
diff --git a/apply.c b/apply.c index cd4cd01..777798a 100644 --- a/apply.c +++ b/apply.c @@ -4386,7 +4386,7 @@ static int create_one_file(struct apply_state *state, ++nr; } } - return error_errno(_("unable to write file '%s' mode %o: %s"), + return error_errno(_("unable to write file '%s' mode %o"), path, mode); } diff --git a/builtin/am.c b/builtin/am.c index 43f7316..8647298 100644 --- a/builtin/am.c +++ b/builtin/am.c @@ -1584,7 +1584,6 @@ static int run_apply(const struct am_state *state, const char *index_file) * If we are allowed to fall back on 3-way merge, don't give false * errors during the initial attempt. */ - if (state->threeway && !index_file) apply_state.be_silent = 1; @@ -1600,6 +1599,7 @@ static int run_apply(const struct am_state *state, const char *index_file) argv_array_clear(&apply_paths); argv_array_clear(&apply_opts); + clear_apply_state(&apply_state); if (res) return res; diff --git a/builtin/apply.c b/builtin/apply.c index 93744f8..ddd61de 100644 --- a/builtin/apply.c +++ b/builtin/apply.c @@ -74,8 +74,6 @@ int cmd_apply(int argc, const char **argv, const char *prefix) OPT_BOOL(0, "allow-overlap", &state.allow_overlap, N_("allow overlapping hunks")), OPT__VERBOSE(&state.apply_verbosely, N_("be verbose")), - OPT_BOOL(0, "silent", &state.be_silent, - N_("do not print any output")), OPT_BIT(0, "inaccurate-eof", &options, N_("tolerate incorrectly detected missing new-line at the end of file"), APPLY_OPT_INACCURATE_EOF), diff --git a/run-command.c b/run-command.c index c09d6b0..af0c8a1 100644 --- a/run-command.c +++ b/run-command.c @@ -85,7 +85,7 @@ static inline void close_pair(int fd[2]) } #ifndef GIT_WINDOWS_NATIVE -static void dup_devnull(int to) +static inline void dup_devnull(int to) { int fd = open("/dev/null", O_RDWR); if (fd < 0)