mirror of
https://github.com/git/git.git
synced 2024-11-27 12:03:55 +08:00
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
This commit is contained in:
commit
47fa106617
@ -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));
|
||||
|
@ -349,6 +349,10 @@ test_expect_success 'git add --dry-run --ignore-missing of non-existing file out
|
||||
test_cmp expect.err actual.err
|
||||
'
|
||||
|
||||
test_expect_success 'git add --dry-run --interactive should fail' '
|
||||
test_must_fail git add --dry-run --interactive
|
||||
'
|
||||
|
||||
test_expect_success 'git add empty string should fail' '
|
||||
test_must_fail git add ""
|
||||
'
|
||||
|
Loading…
Reference in New Issue
Block a user