aboutsummaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2009-12-05 11:39:13 -0800
committerJunio C Hamano <gitster@pobox.com>2009-12-05 11:39:13 -0800
commit3880c18336a77b1a37ec88e5a515498c73eb5551 (patch)
tree33fc7550fe84438699baebaca89bf836f44fb328 /t
parent1a56be134f9477296a7ade040e8b802bf3a643a1 (diff)
parentaa031314bf8189a15290d5bd0d85fa2a0307ceb7 (diff)
downloadgit-3880c18336a77b1a37ec88e5a515498c73eb5551.tar.gz
git-3880c18336a77b1a37ec88e5a515498c73eb5551.tar.xz
Sync with 1.6.5.5
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-xt/t7103-reset-bare.sh32
1 files changed, 29 insertions, 3 deletions
diff --git a/t/t7103-reset-bare.sh b/t/t7103-reset-bare.sh
index 42bf518c6..68041df5f 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"
'