]>
Commit | Line | Data |
---|---|---|
0d66e959 CJ |
1 | #!/bin/sh |
2 | ||
3 | test_description='test cherry-picking an empty commit' | |
4 | ||
5 | . ./test-lib.sh | |
6 | ||
7 | test_expect_success setup ' | |
8 | ||
9 | echo first > file1 && | |
10 | git add file1 && | |
11 | test_tick && | |
12 | git commit -m "first" && | |
13 | ||
14 | git checkout -b empty-branch && | |
15 | test_tick && | |
2c048a30 CC |
16 | git commit --allow-empty -m "empty" && |
17 | ||
18 | echo third >> file1 && | |
19 | git add file1 && | |
20 | test_tick && | |
21 | git commit --allow-empty-message -m "" | |
0d66e959 CJ |
22 | |
23 | ' | |
24 | ||
c6720cfa | 25 | test_expect_success 'cherry-pick an empty commit' ' |
2c048a30 CC |
26 | git checkout master && { |
27 | git cherry-pick empty-branch^ | |
28 | test "$?" = 1 | |
29 | } | |
30 | ' | |
31 | ||
32 | test_expect_success 'index lockfile was removed' ' | |
33 | ||
34 | test ! -f .git/index.lock | |
35 | ||
36 | ' | |
37 | ||
38 | test_expect_success 'cherry-pick a commit with an empty message' ' | |
c6720cfa JH |
39 | git checkout master && { |
40 | git cherry-pick empty-branch | |
41 | test "$?" = 1 | |
42 | } | |
0d66e959 CJ |
43 | ' |
44 | ||
45 | test_expect_success 'index lockfile was removed' ' | |
46 | ||
47 | test ! -f .git/index.lock | |
48 | ||
49 | ' | |
50 | ||
51 | test_done |