stash -p: respect the add.interactive.usebuiltin setting

As `git add` traditionally did not expose the `--patch=<mode>` modes via
command-line options, `git stash` had to call `git add--interactive`
directly.

But this prevents the built-in `add -p` from kicking in, as
`add--interactive` is the Perl script.

So let's introduce support for an optional `<mode>` argument in `git add
--patch[=<mode>]`, and use that in `git stash -p`, so that the built-in
interactive add can do its job if configured.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This commit is contained in:
Johannes Schindelin
2019-03-24 19:55:08 +01:00
parent 2235a37cb7
commit f55e209db6
4 changed files with 20 additions and 9 deletions

View File

@@ -295,7 +295,8 @@ int delayed_reachability_test(struct shallow_info *si, int c);
void prune_shallow(unsigned options);
extern struct trace_key trace_shallow;
int interactive_add(int argc, const char **argv, const char *prefix, int patch);
int interactive_add(int argc, const char **argv, const char *prefix,
const char *patch_mode);
int run_add_interactive(const char *revision, const char *patch_mode,
const struct pathspec *pathspec);