mirror of
https://github.com/git-for-windows/git.git
synced 2026-03-19 11:35:17 -05:00
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:
@@ -355,7 +355,8 @@ static const char *prepare_index(int argc, const char **argv, const char *prefix
|
||||
old_index_env = xstrdup_or_null(getenv(INDEX_ENVIRONMENT));
|
||||
setenv(INDEX_ENVIRONMENT, get_lock_file_path(&index_lock), 1);
|
||||
|
||||
if (interactive_add(argc, argv, prefix, patch_interactive) != 0)
|
||||
if (interactive_add(argc, argv, prefix,
|
||||
patch_interactive ? "" : NULL) != 0)
|
||||
die(_("interactive add failed"));
|
||||
|
||||
if (old_index_env && *old_index_env)
|
||||
|
||||
Reference in New Issue
Block a user