Junio C Hamano | 29e4d36 | 2005-12-20 00:02:15 -0800 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | |
| 3 | test_description='racy GIT' |
| 4 | |
Ævar Arnfjörð Bjarmason | c150064 | 2021-10-12 15:56:37 +0200 | [diff] [blame] | 5 | TEST_PASSES_SANITIZE_LEAK=true |
Junio C Hamano | 29e4d36 | 2005-12-20 00:02:15 -0800 | [diff] [blame] | 6 | . ./test-lib.sh |
| 7 | |
| 8 | # This test can give false success if your machine is sufficiently |
| 9 | # slow or your trial happened to happen on second boundary. |
| 10 | |
Junio C Hamano | 407c8eb | 2005-12-20 12:12:18 -0800 | [diff] [blame] | 11 | for trial in 0 1 2 3 4 |
Junio C Hamano | 29e4d36 | 2005-12-20 00:02:15 -0800 | [diff] [blame] | 12 | do |
| 13 | rm -f .git/index |
| 14 | echo frotz >infocom |
Junio C Hamano | 407c8eb | 2005-12-20 12:12:18 -0800 | [diff] [blame] | 15 | git update-index --add infocom |
Junio C Hamano | 29e4d36 | 2005-12-20 00:02:15 -0800 | [diff] [blame] | 16 | echo xyzzy >infocom |
| 17 | |
Elia Pinto | 8fc5593 | 2014-04-28 05:57:25 -0700 | [diff] [blame] | 18 | files=$(git diff-files -p) |
Junio C Hamano | 29e4d36 | 2005-12-20 00:02:15 -0800 | [diff] [blame] | 19 | test_expect_success \ |
Junio C Hamano | 407c8eb | 2005-12-20 12:12:18 -0800 | [diff] [blame] | 20 | "Racy GIT trial #$trial part A" \ |
Junio C Hamano | 29e4d36 | 2005-12-20 00:02:15 -0800 | [diff] [blame] | 21 | 'test "" != "$files"' |
Junio C Hamano | 407c8eb | 2005-12-20 12:12:18 -0800 | [diff] [blame] | 22 | |
| 23 | sleep 1 |
| 24 | echo xyzzy >cornerstone |
| 25 | git update-index --add cornerstone |
| 26 | |
Elia Pinto | 8fc5593 | 2014-04-28 05:57:25 -0700 | [diff] [blame] | 27 | files=$(git diff-files -p) |
Junio C Hamano | 407c8eb | 2005-12-20 12:12:18 -0800 | [diff] [blame] | 28 | test_expect_success \ |
| 29 | "Racy GIT trial #$trial part B" \ |
| 30 | 'test "" != "$files"' |
| 31 | |
Junio C Hamano | 29e4d36 | 2005-12-20 00:02:15 -0800 | [diff] [blame] | 32 | done |
| 33 | |
| 34 | test_done |