Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2023-07-19 16:37:39 +0300
committerJunio C Hamano <gitster@pobox.com>2023-07-20 08:02:53 +0300
commit3821eb6c3dedba1c57522a1254a916f5ad0d15dc (patch)
tree8b7e512474231c28e77df75fca02b246a44a115a /t
parentfb7d80edcae482f4fa5d4be0227dc3054734e5f3 (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-xt/t7102-reset.sh10
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 &&