Skip to content

Commit a45bb75

Browse files
john-caigitster
authored andcommitted
t5306-pack-nobase: modernize test format
Some tests still use the old format with four spaces indentation. Standardize the tests to the new format with tab indentation. Signed-off-by: John Cai <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent aac8640 commit a45bb75

File tree

1 file changed

+45
-49
lines changed

1 file changed

+45
-49
lines changed

t/t5306-pack-nobase.sh

Lines changed: 45 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -12,71 +12,67 @@ TEST_PASSES_SANITIZE_LEAK=true
1212

1313
# Create A-B chain
1414
#
15-
test_expect_success \
16-
'setup base' \
17-
'test_write_lines a b c d e f g h i >text &&
18-
echo side >side &&
19-
git update-index --add text side &&
20-
A=$(echo A | git commit-tree $(git write-tree)) &&
15+
test_expect_success 'setup base' '
16+
test_write_lines a b c d e f g h i >text &&
17+
echo side >side &&
18+
git update-index --add text side &&
19+
A=$(echo A | git commit-tree $(git write-tree)) &&
2120
22-
echo m >>text &&
23-
git update-index text &&
24-
B=$(echo B | git commit-tree $(git write-tree) -p $A) &&
25-
git update-ref HEAD $B
26-
'
21+
echo m >>text &&
22+
git update-index text &&
23+
B=$(echo B | git commit-tree $(git write-tree) -p $A) &&
24+
git update-ref HEAD $B
25+
'
2726

2827
# Create repository with C whose parent is B.
2928
# Repository contains C, C^{tree}, C:text, B, B^{tree}.
3029
# Repository is missing B:text (best delta base for C:text).
3130
# Repository is missing A (parent of B).
3231
# Repository is missing A:side.
3332
#
34-
test_expect_success \
35-
'setup patch_clone' \
36-
'base_objects=$(pwd)/.git/objects &&
37-
(mkdir patch_clone &&
38-
cd patch_clone &&
39-
git init &&
40-
echo "$base_objects" >.git/objects/info/alternates &&
41-
echo q >>text &&
42-
git read-tree $B &&
43-
git update-index text &&
44-
git update-ref HEAD $(echo C | git commit-tree $(git write-tree) -p $B) &&
45-
rm .git/objects/info/alternates &&
33+
test_expect_success 'setup patch_clone' '
34+
base_objects=$(pwd)/.git/objects &&
35+
(mkdir patch_clone &&
36+
cd patch_clone &&
37+
git init &&
38+
echo "$base_objects" >.git/objects/info/alternates &&
39+
echo q >>text &&
40+
git read-tree $B &&
41+
git update-index text &&
42+
git update-ref HEAD $(echo C | git commit-tree $(git write-tree) -p $B) &&
43+
rm .git/objects/info/alternates &&
4644
47-
git --git-dir=../.git cat-file commit $B |
48-
git hash-object -t commit -w --stdin &&
45+
git --git-dir=../.git cat-file commit $B |
46+
git hash-object -t commit -w --stdin &&
4947
50-
git --git-dir=../.git cat-file tree "$B^{tree}" |
51-
git hash-object -t tree -w --stdin
52-
) &&
53-
C=$(git --git-dir=patch_clone/.git rev-parse HEAD)
54-
'
48+
git --git-dir=../.git cat-file tree "$B^{tree}" |
49+
git hash-object -t tree -w --stdin
50+
) &&
51+
C=$(git --git-dir=patch_clone/.git rev-parse HEAD)
52+
'
5553

5654
# Clone patch_clone indirectly by cloning base and fetching.
5755
#
58-
test_expect_success \
59-
'indirectly clone patch_clone' \
60-
'(mkdir user_clone &&
61-
cd user_clone &&
62-
git init &&
63-
git pull ../.git &&
64-
test $(git rev-parse HEAD) = $B &&
56+
test_expect_success 'indirectly clone patch_clone' '
57+
(mkdir user_clone &&
58+
cd user_clone &&
59+
git init &&
60+
git pull ../.git &&
61+
test $(git rev-parse HEAD) = $B &&
6562
66-
git pull ../patch_clone/.git &&
67-
test $(git rev-parse HEAD) = $C
68-
)
69-
'
63+
git pull ../patch_clone/.git &&
64+
test $(git rev-parse HEAD) = $C
65+
)
66+
'
7067

7168
# Cloning the patch_clone directly should fail.
7269
#
73-
test_expect_success \
74-
'clone of patch_clone is incomplete' \
75-
'(mkdir user_direct &&
76-
cd user_direct &&
77-
git init &&
78-
test_must_fail git fetch ../patch_clone/.git
79-
)
80-
'
70+
test_expect_success 'clone of patch_clone is incomplete' '
71+
(mkdir user_direct &&
72+
cd user_direct &&
73+
git init &&
74+
test_must_fail git fetch ../patch_clone/.git
75+
)
76+
'
8177

8278
test_done

0 commit comments

Comments
 (0)