X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=t%2Ft7103-reset-bare.sh;h=1eef93c2b292c8ec649f12c826587365e5a0d0e6;hb=c00cf45fa35d8aaa31c479ae7502286837fc4dc6;hp=afb55b3a463f79be83c0e3cc4a8aff8a0c6676be;hpb=e25ccff14071ec3628153992acc82b9922e16938;p=git.git diff --git a/t/t7103-reset-bare.sh b/t/t7103-reset-bare.sh index afb55b3a4..1eef93c2b 100755 --- a/t/t7103-reset-bare.sh +++ b/t/t7103-reset-bare.sh @@ -11,21 +11,26 @@ test_expect_success 'setup non-bare' ' git commit -a -m two ' -test_expect_success 'hard reset requires a worktree' ' +test_expect_success '"hard" reset requires a worktree' ' (cd .git && test_must_fail git reset --hard) ' -test_expect_success 'merge reset requires a worktree' ' +test_expect_success '"merge" reset requires a worktree' ' (cd .git && test_must_fail git reset --merge) ' -test_expect_success 'mixed reset is ok' ' +test_expect_success '"keep" reset requires a worktree' ' + (cd .git && + test_must_fail git reset --keep) +' + +test_expect_success '"mixed" reset is ok' ' (cd .git && git reset) ' -test_expect_success 'soft reset is ok' ' +test_expect_success '"soft" reset is ok' ' (cd .git && git reset --soft) ' @@ -40,19 +45,23 @@ test_expect_success 'setup bare' ' cd bare.git ' -test_expect_success 'hard reset is not allowed in bare' ' +test_expect_success '"hard" reset is not allowed in bare' ' test_must_fail git reset --hard HEAD^ ' -test_expect_success 'merge reset is not allowed in bare' ' +test_expect_success '"merge" reset is not allowed in bare' ' test_must_fail git reset --merge HEAD^ ' -test_expect_success 'mixed reset is not allowed in bare' ' +test_expect_success '"keep" reset is not allowed in bare' ' + test_must_fail git reset --keep HEAD^ +' + +test_expect_success '"mixed" reset is not allowed in bare' ' test_must_fail git reset --mixed HEAD^ ' -test_expect_success 'soft reset is allowed in bare' ' +test_expect_success '"soft" reset is allowed in bare' ' git reset --soft HEAD^ && test "`git show --pretty=format:%s | head -n 1`" = "one" '