From 90a6bb98d11a664f729dbb86c90d9c7a38ea825a Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Sat, 21 Dec 2019 21:57:12 +0000 Subject: legacy stash -p: respect the add.interactive.usebuiltin setting As `git add` traditionally did not expose the `--patch=` modes via command-line options, the scripted version of `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 scripted version (which does not have a "fall-back" to the built-in version). So let's introduce support for internal switch for `git add` that the scripted `git stash` can use to call the appropriate backend (scripted or built-in, depending on `add.interactive.useBuiltin`). Signed-off-by: Johannes Schindelin Signed-off-by: Junio C Hamano --- git-legacy-stash.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'git-legacy-stash.sh') diff --git a/git-legacy-stash.sh b/git-legacy-stash.sh index 07ad4a5459..ed039dfcbb 100755 --- a/git-legacy-stash.sh +++ b/git-legacy-stash.sh @@ -206,7 +206,7 @@ create_stash () { # find out what the user wants GIT_INDEX_FILE="$TMP-index" \ - git add--interactive --patch=stash -- "$@" && + git add --legacy-stash-p -- "$@" && # state of the working tree w_tree=$(GIT_INDEX_FILE="$TMP-index" git write-tree) || -- cgit v1.2.1