summaryrefslogtreecommitdiff
path: root/t/t7103-reset-bare.sh
diff options
context:
space:
mode:
Diffstat (limited to 't/t7103-reset-bare.sh')
-rwxr-xr-xt/t7103-reset-bare.sh28
1 files changed, 28 insertions, 0 deletions
diff --git a/t/t7103-reset-bare.sh b/t/t7103-reset-bare.sh
new file mode 100755
index 0000000000..cdecebe456
--- /dev/null
+++ b/t/t7103-reset-bare.sh
@@ -0,0 +1,28 @@
+#!/bin/sh
+
+test_description='git-reset in a bare repository'
+. ./test-lib.sh
+
+test_expect_success 'setup non-bare' '
+ echo one >file &&
+ git add file &&
+ git commit -m one &&
+ echo two >file &&
+ git commit -a -m two
+'
+
+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 'soft reset is allowed' '
+ git reset --soft HEAD^ &&
+ test "`git show --pretty=format:%s | head -n 1`" = "one"
+'
+
+test_done