Skip to content

Commit 06ac518

Browse files
committed
Merge branch 'ag/t0010-modernize'
GSoC practice to modernize a test script. * ag/t0010-modernize: tests: modernize the test script t0010-racy-git.sh
2 parents 8e663af + 1605035 commit 06ac518

File tree

1 file changed

+15
-16
lines changed

1 file changed

+15
-16
lines changed

t/t0010-racy-git.sh

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,25 +10,24 @@ TEST_PASSES_SANITIZE_LEAK=true
1010

1111
for trial in 0 1 2 3 4
1212
do
13-
rm -f .git/index
14-
echo frotz >infocom
15-
git update-index --add infocom
16-
echo xyzzy >infocom
17-
18-
files=$(git diff-files -p)
19-
test_expect_success \
20-
"Racy GIT trial #$trial part A" \
21-
'test "" != "$files"'
22-
13+
test_expect_success "Racy git trial #$trial part A" '
14+
rm -f .git/index &&
15+
echo frotz >infocom &&
16+
git update-index --add infocom &&
17+
echo xyzzy >infocom &&
18+
19+
git diff-files -p >out &&
20+
test_file_not_empty out
21+
'
2322
sleep 1
24-
echo xyzzy >cornerstone
25-
git update-index --add cornerstone
2623

27-
files=$(git diff-files -p)
28-
test_expect_success \
29-
"Racy GIT trial #$trial part B" \
30-
'test "" != "$files"'
24+
test_expect_success "Racy git trial #$trial part B" '
25+
echo xyzzy >cornerstone &&
26+
git update-index --add cornerstone &&
3127
28+
git diff-files -p >out &&
29+
test_file_not_empty out
30+
'
3231
done
3332

3433
test_done

0 commit comments

Comments
 (0)