diff options
author | Junio C Hamano <gitster@pobox.com> | 2021-05-14 02:26:09 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-05-14 02:26:09 +0300 |
commit | 47fa10661746e32cbc76a88392e1cda38def27c6 (patch) | |
tree | a2b2cd225f4b9ed50b667803ba66ff79ce740503 /builtin | |
parent | e289f681ede1aad2ded33e76518bdc80064f3c16 (diff) | |
parent | a1989cf7b8d062960b6f8de00435711c45b95285 (diff) |
Merge branch 'ow/no-dryrun-in-add-i'
"git add -i --dry-run" does not dry-run, which was surprising. The
combination of options has taught to error out.
* ow/no-dryrun-in-add-i:
add: die if both --dry-run and --interactive are given
Diffstat (limited to 'builtin')
-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 58ee3f954e..b773b5a499 100644 --- a/builtin/add.c +++ b/builtin/add.c @@ -484,6 +484,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)); |