Merge branch 'jk/symbolic-ref-short'
[git/gitweb.git] / t / t3505-cherry-pick-empty.sh
blobc10b28cf5731705b437793a58f5acd6c605ad579
1 #!/bin/sh
3 test_description='test cherry-picking an empty commit'
5 . ./test-lib.sh
7 test_expect_success setup '
9 echo first > file1 &&
10 git add file1 &&
11 test_tick &&
12 git commit -m "first" &&
14 git checkout -b empty-branch &&
15 test_tick &&
16 git commit --allow-empty -m "empty" &&
18 echo third >> file1 &&
19 git add file1 &&
20 test_tick &&
21 git commit --allow-empty-message -m ""
25 test_expect_success 'cherry-pick an empty commit' '
26 git checkout master && {
27 git cherry-pick empty-branch^
28 test "$?" = 1
32 test_expect_success 'index lockfile was removed' '
34 test ! -f .git/index.lock
38 test_expect_success 'cherry-pick a commit with an empty message' '
39 git checkout master && {
40 git cherry-pick empty-branch
41 test "$?" = 1
45 test_expect_success 'index lockfile was removed' '
47 test ! -f .git/index.lock
51 test_done