diff options
author | Ævar Arnfjörð Bjarmason <avarab@gmail.com> | 2023-02-06 23:58:57 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2023-02-06 15:03:34 -0800 |
commit | d21878f073043b9205f5049f1cd53560d67b9f3f (patch) | |
tree | 05b1a3acbedfe9d03218501d5a9bc4acede8d9b2 /builtin/reset.c | |
parent | 20b813d7d3dc576aa58de22da2450b49116945bf (diff) |
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/reset.c')
-rw-r--r-- | builtin/reset.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/builtin/reset.c b/builtin/reset.c index fea20a9ba0..4b59aa9aea 100644 --- a/builtin/reset.c +++ b/builtin/reset.c @@ -26,6 +26,7 @@ #include "submodule.h" #include "submodule-config.h" #include "dir.h" +#include "add-interactive.h" #define REFRESH_INDEX_DELAY_WARNING_IN_MS (2 * 1000) @@ -390,7 +391,8 @@ int cmd_reset(int argc, const char **argv, const char *prefix) if (reset_type != NONE) die(_("options '%s' and '%s' cannot be used together"), "--patch", "--{hard,mixed,soft}"); trace2_cmd_mode("patch-interactive"); - return run_add_interactive(rev, "--patch=reset", &pathspec); + return !!run_add_p(the_repository, ADD_P_RESET, rev, + &pathspec); } /* git reset tree [--] paths... can be used to |