Skip to content

Commit 7cbae72

Browse files
bk2204gitster
authored andcommitted
t2101: modernize test style
Most of our tests start with the opening quote of the test body on the same line as the test_expect_success call. Additionally, our tests are usually indented with a single tab. Update this test to be the same as most others, which will make it easier to use inline heredocs in the future. Signed-off-by: brian m. carlson <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent ae2f8d5 commit 7cbae72

File tree

1 file changed

+29
-23
lines changed

1 file changed

+29
-23
lines changed

t/t2101-update-index-reupdate.sh

Lines changed: 29 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,16 @@ cat > expected <<\EOF
1212
100644 3b18e512dba79e4c8300dd08aeb37f8e728b8dad 0 file1
1313
100644 9db8893856a8a02eaa73470054b7c1c5a7c82e47 0 file2
1414
EOF
15-
test_expect_success 'update-index --add' \
16-
'echo hello world >file1 &&
17-
echo goodbye people >file2 &&
18-
git update-index --add file1 file2 &&
19-
git ls-files -s >current &&
20-
cmp current expected'
15+
test_expect_success 'update-index --add' '
16+
echo hello world >file1 &&
17+
echo goodbye people >file2 &&
18+
git update-index --add file1 file2 &&
19+
git ls-files -s >current &&
20+
cmp current expected
21+
'
2122

22-
test_expect_success 'update-index --again' \
23-
'rm -f file1 &&
23+
test_expect_success 'update-index --again' '
24+
rm -f file1 &&
2425
echo hello everybody >file2 &&
2526
if git update-index --again
2627
then
@@ -29,56 +30,61 @@ test_expect_success 'update-index --again' \
2930
else
3031
echo happy - failed as expected
3132
fi &&
32-
git ls-files -s >current &&
33-
cmp current expected'
33+
git ls-files -s >current &&
34+
cmp current expected
35+
'
3436

3537
cat > expected <<\EOF
3638
100644 0f1ae1422c2bf43f117d3dbd715c988a9ed2103f 0 file2
3739
EOF
38-
test_expect_success 'update-index --remove --again' \
39-
'git update-index --remove --again &&
40-
git ls-files -s >current &&
41-
cmp current expected'
40+
test_expect_success 'update-index --remove --again' '
41+
git update-index --remove --again &&
42+
git ls-files -s >current &&
43+
cmp current expected
44+
'
4245

4346
test_expect_success 'first commit' 'git commit -m initial'
4447

4548
cat > expected <<\EOF
4649
100644 53ab446c3f4e42ce9bb728a0ccb283a101be4979 0 dir1/file3
4750
100644 0f1ae1422c2bf43f117d3dbd715c988a9ed2103f 0 file2
4851
EOF
49-
test_expect_success 'update-index again' \
50-
'mkdir -p dir1 &&
52+
test_expect_success 'update-index again' '
53+
mkdir -p dir1 &&
5154
echo hello world >dir1/file3 &&
5255
echo goodbye people >file2 &&
5356
git update-index --add file2 dir1/file3 &&
5457
echo hello everybody >file2 &&
5558
echo happy >dir1/file3 &&
5659
git update-index --again &&
5760
git ls-files -s >current &&
58-
cmp current expected'
61+
cmp current expected
62+
'
5963

6064
cat > expected <<\EOF
6165
100644 d7fb3f695f06c759dbf3ab00046e7cc2da22d10f 0 dir1/file3
6266
100644 0f1ae1422c2bf43f117d3dbd715c988a9ed2103f 0 file2
6367
EOF
64-
test_expect_success 'update-index --update from subdir' \
65-
'echo not so happy >file2 &&
68+
test_expect_success 'update-index --update from subdir' '
69+
echo not so happy >file2 &&
6670
(cd dir1 &&
6771
cat ../file2 >file3 &&
6872
git update-index --again
6973
) &&
7074
git ls-files -s >current &&
71-
cmp current expected'
75+
cmp current expected
76+
'
7277

7378
cat > expected <<\EOF
7479
100644 594fb5bb1759d90998e2bf2a38261ae8e243c760 0 dir1/file3
7580
100644 0f1ae1422c2bf43f117d3dbd715c988a9ed2103f 0 file2
7681
EOF
77-
test_expect_success 'update-index --update with pathspec' \
78-
'echo very happy >file2 &&
82+
test_expect_success 'update-index --update with pathspec' '
83+
echo very happy >file2 &&
7984
cat file2 >dir1/file3 &&
8085
git update-index --again dir1/ &&
8186
git ls-files -s >current &&
82-
cmp current expected'
87+
cmp current expected
88+
'
8389

8490
test_done

0 commit comments

Comments
 (0)