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