diff options
author | Øystein Walle <oystwa@gmail.com> | 2021-05-05 16:52:04 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-05-07 06:14:04 +0900 |
commit | a1989cf7b8d062960b6f8de00435711c45b95285 (patch) | |
tree | d69953e957e80de89da1c3755cfe1778123482ce /builtin/add.c | |
parent | The thirteenth batch (diff) | |
download | tgif-a1989cf7b8d062960b6f8de00435711c45b95285.tar.xz |
add: die if both --dry-run and --interactive are given
The interactive machinery does not obey --dry-run. Die appropriately
if both flags are passed.
Signed-off-by: Øystein Walle <oystwa@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/add.c')
-rw-r--r-- | builtin/add.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/builtin/add.c b/builtin/add.c index afccf2fd55..5cea3dc857 100644 --- a/builtin/add.c +++ b/builtin/add.c @@ -459,6 +459,8 @@ int cmd_add(int argc, const char **argv, const char *prefix) if (patch_interactive) add_interactive = 1; if (add_interactive) { + if (show_only) + die(_("--dry-run is incompatible with --interactive/--patch")); if (pathspec_from_file) die(_("--pathspec-from-file is incompatible with --interactive/--patch")); exit(interactive_add(argv + 1, prefix, patch_interactive)); |