Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/git/blob/master/t/t7516-commit-races.sh # git [Ported from github.com/git/git] Sync with Git 2.56.1 Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `master` Branches Tags History `git / t / t7516-commit-races.sh` 32 lines ยท 882 bytes Raw Blame History 1 #!/bin/sh 2 3 test_description='git commit races' 4 5 . ./test-lib.sh 6 7 test_expect_success 'race to create orphan commit' ' 8 write_script hare-editor <<-\EOF && 9 git commit --allow-empty -m hare 10 EOF 11 test_must_fail env EDITOR=./hare-editor git commit --allow-empty -m tortoise -e && 12 git show -s --pretty=format:%s >subject && 13 test_grep hare subject && 14 git show -s --pretty=format:%P >out && 15 test_must_be_empty out 16 ' 17 18 test_expect_success 'race to create non-orphan commit' ' 19 write_script airplane-editor <<-\EOF && 20 git commit --allow-empty -m airplane 21 EOF 22 git checkout --orphan branch && 23 git commit --allow-empty -m base && 24 git rev-parse HEAD >base && 25 test_must_fail env EDITOR=./airplane-editor git commit --allow-empty -m ship -e && 26 git show -s --pretty=format:%s >subject && 27 test_grep airplane subject && 28 git rev-parse HEAD^ >parent && 29 test_cmp base parent 30 ' 31 32 test_done