3 test_description
='git commit races'
5 TEST_PASSES_SANITIZE_LEAK
=true
8 test_expect_success
'race to create orphan commit' '
9 write_script hare-editor <<-\EOF &&
10 git commit --allow-empty -m hare
12 test_must_fail env EDITOR=./hare-editor git commit --allow-empty -m tortoise -e &&
13 git show -s --pretty=format:%s >subject &&
15 git show -s --pretty=format:%P >out &&
16 test_must_be_empty out
19 test_expect_success
'race to create non-orphan commit' '
20 write_script airplane-editor <<-\EOF &&
21 git commit --allow-empty -m airplane
23 git checkout --orphan branch &&
24 git commit --allow-empty -m base &&
25 git rev-parse HEAD >base &&
26 test_must_fail env EDITOR=./airplane-editor git commit --allow-empty -m ship -e &&
27 git show -s --pretty=format:%s >subject &&
28 grep airplane subject &&
29 git rev-parse HEAD^ >parent &&