]> git.ipfire.org Git - thirdparty/git.git/blame - t/t7103-reset-bare.sh
t/: Use "test_must_fail git" instead of "! git"
[thirdparty/git.git] / t / t7103-reset-bare.sh
CommitLineData
49b9362f
JK
1#!/bin/sh
2
3test_description='git-reset in a bare repository'
4. ./test-lib.sh
5
6test_expect_success 'setup non-bare' '
7 echo one >file &&
8 git add file &&
9 git commit -m one &&
10 echo two >file &&
11 git commit -a -m two
12'
13
14test_expect_success 'setup bare' '
15 git clone --bare . bare.git &&
16 cd bare.git
17'
18
19test_expect_success 'hard reset is not allowed' '
d492b31c 20 test_must_fail git reset --hard HEAD^
49b9362f
JK
21'
22
23test_expect_success 'soft reset is allowed' '
24 git reset --soft HEAD^ &&
25 test "`git show --pretty=format:%s | head -n 1`" = "one"
26'
27
28test_done