diff options
author | Junio C Hamano <gitster@pobox.com> | 2009-12-05 11:39:13 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2009-12-05 11:39:13 -0800 |
commit | 3880c18336a77b1a37ec88e5a515498c73eb5551 (patch) | |
tree | 33fc7550fe84438699baebaca89bf836f44fb328 /t | |
parent | Merge branch 'maint' (diff) | |
parent | Git 1.6.5.5 (diff) | |
download | tgif-3880c18336a77b1a37ec88e5a515498c73eb5551.tar.xz |
Sync with 1.6.5.5
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-x | t/t7103-reset-bare.sh | 32 |
1 files changed, 29 insertions, 3 deletions
diff --git a/t/t7103-reset-bare.sh b/t/t7103-reset-bare.sh index 42bf518c68..68041df5f4 100755 --- a/t/t7103-reset-bare.sh +++ b/t/t7103-reset-bare.sh @@ -11,16 +11,42 @@ test_expect_success 'setup non-bare' ' git commit -a -m two ' +test_expect_success 'hard reset requires a worktree' ' + (cd .git && + test_must_fail git reset --hard) +' + +test_expect_success 'merge reset requires a worktree' ' + (cd .git && + test_must_fail git reset --merge) +' + +test_expect_success 'mixed reset is ok' ' + (cd .git && git reset) +' + +test_expect_success 'soft reset is ok' ' + (cd .git && git reset --soft) +' + test_expect_success 'setup bare' ' git clone --bare . bare.git && cd bare.git ' -test_expect_success 'hard reset is not allowed' ' - test_must_fail git reset --hard HEAD^ +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_must_fail git reset --merge 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' ' +test_expect_success 'soft reset is allowed in bare' ' git reset --soft HEAD^ && test "`git show --pretty=format:%s | head -n 1`" = "one" ' |