add: remove support for `git-legacy-stash`

In 90a6bb98d11 (legacy stash -p: respect the add.interactive.usebuiltin setting, 2019-12-21), we added support to use the built-in `add -p` from the scripted `stash -p`. In 8a2cd3f5123 (stash: remove the stash.useBuiltin setting, 2020-03-03), we retired the scripted `stash` (including the scripted `stash -p`). Therefore this support is no longer necessary. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Johannes Schindelin committed Jan 27, 2022 at 22:03 UTC 5d4dc38bfd484fda1944f131189f7e53abb90c1d
1 file changed -14
builtin/add.c
-14
@@ -32,7 +32,6 @@ static int add_renormalize;
32 static int pathspec_file_nul;
33 static int include_sparse;
34 static const char *pathspec_from_file;
35 -static int legacy_stash_p; /* support for the scripted `git stash` */
35
36 struct update_callback_data {
37 int flags;
@@ -388,8 +387,6 @@ static struct option builtin_add_options[] = {
387 N_("override the executable bit of the listed files")),
388 OPT_HIDDEN_BOOL(0, "warn-embedded-repo", &warn_on_embedded_repo,
389 N_("warn when adding an embedded repository")),
391 - OPT_HIDDEN_BOOL(0, "legacy-stash-p", &legacy_stash_p,
392 - N_("backend for `git stash -p`")),
390 OPT_PATHSPEC_FROM_FILE(&pathspec_from_file),
391 OPT_PATHSPEC_FILE_NUL(&pathspec_file_nul),
392 OPT_END(),
@@ -512,17 +509,6 @@ int cmd_add(int argc, const char **argv, const char *prefix)
509 die(_("options '%s' and '%s' cannot be used together"), "--pathspec-from-file", "--interactive/--patch");
510 exit(interactive_add(argv + 1, prefix, patch_interactive));
511 }
515 - if (legacy_stash_p) {
516 - struct pathspec pathspec;
517 -
518 - parse_pathspec(&pathspec, 0,
519 - PATHSPEC_PREFER_FULL |
520 - PATHSPEC_SYMLINK_LEADING_PATH |
521 - PATHSPEC_PREFIX_ORIGIN,
522 - prefix, argv);
523 -
524 - return run_add_interactive(NULL, "--patch=stash", &pathspec);
525 - }
512
513 if (edit_interactive) {
514 if (pathspec_from_file)