diff options
author | Junio C Hamano <gitster@pobox.com> | 2023-07-19 16:37:39 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2023-07-20 08:02:53 +0300 |
commit | 3821eb6c3dedba1c57522a1254a916f5ad0d15dc (patch) | |
tree | 8b7e512474231c28e77df75fca02b246a44a115a /t | |
parent | fb7d80edcae482f4fa5d4be0227dc3054734e5f3 (diff) |
reset: reject --no-(mixed|soft|hard|merge|keep) option
"git reset --no-mixed" behaved exactly like "git reset --mixed",
which was nonsense.
If there were only two kinds, e.g. "mixed" vs "separate", it might
have made sense to make "git reset --no-mixed" behave identically to
"git reset --separate" and vice-versa, but because we have many
types of reset, let's just forbid "--no-mixed" and negated form of
other types.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-x | t/t7102-reset.sh | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/t/t7102-reset.sh b/t/t7102-reset.sh index 22477f3a31..4287863ae6 100755 --- a/t/t7102-reset.sh +++ b/t/t7102-reset.sh @@ -71,6 +71,16 @@ check_changes () { done | test_cmp .cat_expect - } +# no negated form for various type of resets +for opt in soft mixed hard merge keep +do + test_expect_success "no 'git reset --no-$opt'" ' + test_when_finished "rm -f err" && + test_must_fail git reset --no-$opt 2>err && + grep "error: unknown option .no-$opt." err + ' +done + test_expect_success 'reset --hard message' ' hex=$(git log -1 --format="%h") && git reset --hard >.actual && |