Merge branch 'jc/parse-options-reset'

Command line parser fix.

* jc/parse-options-reset:
  reset: reject --no-(mixed|soft|hard|merge|keep) option
This commit is contained in:
Junio C Hamano
2023-07-27 15:26:37 -07:00
2 changed files with 28 additions and 11 deletions

View File

@ -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 &&