diff options
author | Ævar Arnfjörð Bjarmason <avarab@gmail.com> | 2023-02-06 22:58:57 (GMT) |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2023-02-06 23:03:34 (GMT) |
commit | d21878f073043b9205f5049f1cd53560d67b9f3f (patch) | |
tree | 05b1a3acbedfe9d03218501d5a9bc4acede8d9b2 /builtin/stash.c | |
parent | 20b813d7d3dc576aa58de22da2450b49116945bf (diff) | |
download | git-d21878f073043b9205f5049f1cd53560d67b9f3f.zip git-d21878f073043b9205f5049f1cd53560d67b9f3f.tar.gz git-d21878f073043b9205f5049f1cd53560d67b9f3f.tar.bz2 |
add API: remove run_add_interactive() wrapper function
Now that the Perl "git-add--interactive" has gone away in the
preceding commit we don't need to pass along our desire for a mode as
a string, and can instead directly use the "enum add_p_mode", see
d2a233cb8b9 (built-in add -p: prepare for patch modes other than
"stage", 2019-12-21) for its introduction.
As a result of that the run_add_interactive() function would become a
trivial wrapper which would only run run_add_i() if a 0 (or now,
"NULL") "patch_mode" was provided. Let's instead remove it, and have
the one callsite that wanted the "NULL" case (interactive_add())
handle it.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/stash.c')
-rw-r--r-- | builtin/stash.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/builtin/stash.c b/builtin/stash.c index 839569a..9fcd2e5 100644 --- a/builtin/stash.c +++ b/builtin/stash.c @@ -18,6 +18,7 @@ #include "diffcore.h" #include "exec-cmd.h" #include "reflog.h" +#include "add-interactive.h" #define INCLUDE_ALL_FILES 2 @@ -1229,7 +1230,7 @@ static int stash_patch(struct stash_info *info, const struct pathspec *ps, old_index_env = xstrdup_or_null(getenv(INDEX_ENVIRONMENT)); setenv(INDEX_ENVIRONMENT, the_repository->index_file, 1); - ret = run_add_interactive(NULL, "--patch=stash", ps); + ret = !!run_add_p(the_repository, ADD_P_STASH, NULL, ps); the_repository->index_file = old_repo_index_file; if (old_index_env && *old_index_env) |