From: Johannes Schindelin Date: Thu, 08 Nov 2007 14:14:37 GMT Subject: [PATCH 4/3] t3700: avoid racy git situation Message-ID: In-Reply-To: Wow, the builtin commit is fast. It sometimes triggers a racy situation in the test case for "git add --refresh -- foo". So when that test fails, simply sleep one second and try again. Signed-off-by: Johannes Schindelin --- t/t3700-add.sh | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git a/t/t3700-add.sh b/t/t3700-add.sh index a328bf5..f4950a3 100755 --- a/t/t3700-add.sh +++ b/t/t3700-add.sh @@ -152,7 +152,12 @@ test_expect_success 'git add --refresh' ' *) echo fail; (exit 1);; esac && git add --refresh -- foo && - test -z "`git diff-index HEAD -- foo`" + test -z "`git diff-index HEAD -- foo`" || { + echo Sleeping one second to avoid racy situation && + sleep 1 && + git add --refresh -- foo && + test -z "`git diff-index HEAD -- foo`" + } ' test_done -- 1.5.3.5.1634.g0fa78