t5400,t5402: consistently indent with tabs, not with spaces
This patch actually prepares for the upcoming patches to replace `master` with `main` in these tests: we do not want those changes to be flagged by the new `check-whitespace` GitHub workflow (even if those changes do not introduce the whitespace issues, they touch lines affected by those issues without fixing them). Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Johannes Schindelin committed
Nov 9, 2020 at 00:09 UTC
739edb2a738823cfc345defb644811134fb4576c
2 files changed
+85
-84
t/t5400-send-pack.sh
+77
-76
@@ -21,14 +21,15 @@ test_expect_success setup '
21
i=0 &&
22
while test $i -le $cnt
23
do
24
- i=$(($i+1)) &&
25
- test_tick &&
26
- echo "Commit #$i" >mozart/is/pink &&
27
- git update-index --add mozart/is/pink &&
28
- tree=$(git write-tree) &&
29
- commit=$(echo "Commit #$i" | git commit-tree $tree -p $parent) &&
30
- git update-ref refs/tags/commit$i $commit &&
31
- parent=$commit || return 1
24
+ i=$(($i+1)) &&
25
+ test_tick &&
26
+ echo "Commit #$i" >mozart/is/pink &&
27
+ git update-index --add mozart/is/pink &&
28
+ tree=$(git write-tree) &&
29
+ commit=$(echo "Commit #$i" |
30
+ git commit-tree $tree -p $parent) &&
31
+ git update-ref refs/tags/commit$i $commit &&
32
+ parent=$commit || return 1
33
done &&
34
git update-ref HEAD "$commit" &&
35
git clone ./. victim &&
@@ -38,14 +39,14 @@ test_expect_success setup '
39
i=0 &&
40
while test $i -le $cnt
41
do
41
- i=$(($i+1)) &&
42
- test_tick &&
43
- echo "Rebase #$i" >mozart/is/pink &&
44
- git update-index --add mozart/is/pink &&
45
- tree=$(git write-tree) &&
46
- commit=$(echo "Rebase #$i" | git commit-tree $tree -p $parent) &&
47
- git update-ref refs/tags/rebase$i $commit &&
48
- parent=$commit || return 1
42
+ i=$(($i+1)) &&
43
+ test_tick &&
44
+ echo "Rebase #$i" >mozart/is/pink &&
45
+ git update-index --add mozart/is/pink &&
46
+ tree=$(git write-tree) &&
47
+ commit=$(echo "Rebase #$i" | git commit-tree $tree -p $parent) &&
48
+ git update-ref refs/tags/rebase$i $commit &&
49
+ parent=$commit || return 1
50
done &&
51
git update-ref HEAD "$commit" &&
52
echo Rebase &&
@@ -57,11 +58,11 @@ test_expect_success 'pack the source repository' '
58
'
59
60
test_expect_success 'pack the destination repository' '
60
- (
61
- cd victim &&
62
- git repack -a -d &&
63
- git prune
64
- )
61
+ (
62
+ cd victim &&
63
+ git repack -a -d &&
64
+ git prune
65
+ )
66
'
67
68
test_expect_success 'refuse pushing rewound head without --force' '
@@ -85,10 +86,10 @@ test_expect_success 'push can be used to delete a ref' '
86
87
test_expect_success 'refuse deleting push with denyDeletes' '
88
(
88
- cd victim &&
89
- test_might_fail git branch -D extra &&
90
- git config receive.denyDeletes true &&
91
- git branch extra master
89
+ cd victim &&
90
+ test_might_fail git branch -D extra &&
91
+ git config receive.denyDeletes true &&
92
+ git branch extra master
93
) &&
94
test_must_fail git send-pack ./victim :extra master
95
'
@@ -118,9 +119,9 @@ test_expect_success 'override denyDeletes with git -c receive-pack' '
119
120
test_expect_success 'denyNonFastforwards trumps --force' '
121
(
121
- cd victim &&
122
- test_might_fail git branch -D extra &&
123
- git config receive.denyNonFastforwards true
122
+ cd victim &&
123
+ test_might_fail git branch -D extra &&
124
+ git config receive.denyNonFastforwards true
125
) &&
126
victim_orig=$(cd victim && git rev-parse --verify master) &&
127
test_must_fail git send-pack --force ./victim master^:master &&
@@ -143,16 +144,16 @@ test_expect_success 'send-pack --all sends all branches' '
144
test_expect_success 'push --all excludes remote-tracking hierarchy' '
145
mkdir parent &&
146
(
146
- cd parent &&
147
- git init && : >file && git add file && git commit -m add
147
+ cd parent &&
148
+ git init && : >file && git add file && git commit -m add
149
) &&
150
git clone parent child &&
151
(
151
- cd child && git push --all
152
+ cd child && git push --all
153
) &&
154
(
154
- cd parent &&
155
- test -z "$(git for-each-ref refs/remotes/origin)"
155
+ cd parent &&
156
+ test -z "$(git for-each-ref refs/remotes/origin)"
157
)
158
'
159
@@ -160,33 +161,33 @@ test_expect_success 'receive-pack runs auto-gc in remote repo' '
161
rm -rf parent child &&
162
git init parent &&
163
(
163
- # Setup a repo with 2 packs
164
- cd parent &&
165
- echo "Some text" >file.txt &&
166
- git add . &&
167
- git commit -m "Initial commit" &&
168
- git repack -adl &&
169
- echo "Some more text" >>file.txt &&
170
- git commit -a -m "Second commit" &&
171
- git repack
164
+ # Setup a repo with 2 packs
165
+ cd parent &&
166
+ echo "Some text" >file.txt &&
167
+ git add . &&
168
+ git commit -m "Initial commit" &&
169
+ git repack -adl &&
170
+ echo "Some more text" >>file.txt &&
171
+ git commit -a -m "Second commit" &&
172
+ git repack
173
) &&
174
cp -R parent child &&
175
(
175
- # Set the child to auto-pack if more than one pack exists
176
- cd child &&
177
- git config gc.autopacklimit 1 &&
178
- git config gc.autodetach false &&
179
- git branch test_auto_gc &&
180
- # And create a file that follows the temporary object naming
181
- # convention for the auto-gc to remove
182
- : >.git/objects/tmp_test_object &&
183
- test-tool chmtime =-1209601 .git/objects/tmp_test_object
176
+ # Set the child to auto-pack if more than one pack exists
177
+ cd child &&
178
+ git config gc.autopacklimit 1 &&
179
+ git config gc.autodetach false &&
180
+ git branch test_auto_gc &&
181
+ # And create a file that follows the temporary object naming
182
+ # convention for the auto-gc to remove
183
+ : >.git/objects/tmp_test_object &&
184
+ test-tool chmtime =-1209601 .git/objects/tmp_test_object
185
) &&
186
(
186
- cd parent &&
187
- echo "Even more text" >>file.txt &&
188
- git commit -a -m "Third commit" &&
189
- git send-pack ../child HEAD:refs/heads/test_auto_gc
187
+ cd parent &&
188
+ echo "Even more text" >>file.txt &&
189
+ git commit -a -m "Third commit" &&
190
+ git send-pack ../child HEAD:refs/heads/test_auto_gc
191
) &&
192
test ! -e child/.git/objects/tmp_test_object
193
'
@@ -195,15 +196,15 @@ rewound_push_setup() {
196
rm -rf parent child &&
197
mkdir parent &&
198
(
198
- cd parent &&
199
- git init &&
200
- echo one >file && git add file && git commit -m one &&
201
- git config receive.denyCurrentBranch warn &&
202
- echo two >file && git commit -a -m two
199
+ cd parent &&
200
+ git init &&
201
+ echo one >file && git add file && git commit -m one &&
202
+ git config receive.denyCurrentBranch warn &&
203
+ echo two >file && git commit -a -m two
204
) &&
205
git clone parent child &&
206
(
206
- cd child && git reset --hard HEAD^
207
+ cd child && git reset --hard HEAD^
208
)
209
}
210
@@ -211,16 +212,16 @@ test_expect_success 'pushing explicit refspecs respects forcing' '
212
rewound_push_setup &&
213
parent_orig=$(cd parent && git rev-parse --verify master) &&
214
(
214
- cd child &&
215
- test_must_fail git send-pack ../parent \
216
- refs/heads/master:refs/heads/master
215
+ cd child &&
216
+ test_must_fail git send-pack ../parent \
217
+ refs/heads/master:refs/heads/master
218
) &&
219
parent_head=$(cd parent && git rev-parse --verify master) &&
220
test "$parent_orig" = "$parent_head" &&
221
(
221
- cd child &&
222
- git send-pack ../parent \
223
- +refs/heads/master:refs/heads/master
222
+ cd child &&
223
+ git send-pack ../parent \
224
+ +refs/heads/master:refs/heads/master
225
) &&
226
parent_head=$(cd parent && git rev-parse --verify master) &&
227
child_head=$(cd child && git rev-parse --verify master) &&
@@ -231,16 +232,16 @@ test_expect_success 'pushing wildcard refspecs respects forcing' '
232
rewound_push_setup &&
233
parent_orig=$(cd parent && git rev-parse --verify master) &&
234
(
234
- cd child &&
235
- test_must_fail git send-pack ../parent \
236
- "refs/heads/*:refs/heads/*"
235
+ cd child &&
236
+ test_must_fail git send-pack ../parent \
237
+ "refs/heads/*:refs/heads/*"
238
) &&
239
parent_head=$(cd parent && git rev-parse --verify master) &&
240
test "$parent_orig" = "$parent_head" &&
241
(
241
- cd child &&
242
- git send-pack ../parent \
243
- "+refs/heads/*:refs/heads/*"
242
+ cd child &&
243
+ git send-pack ../parent \
244
+ "+refs/heads/*:refs/heads/*"
245
) &&
246
parent_head=$(cd parent && git rev-parse --verify master) &&
247
child_head=$(cd child && git rev-parse --verify master) &&
@@ -250,8 +251,8 @@ test_expect_success 'pushing wildcard refspecs respects forcing' '
251
test_expect_success 'deny pushing to delete current branch' '
252
rewound_push_setup &&
253
(
253
- cd child &&
254
- test_must_fail git send-pack ../parent :refs/heads/master 2>errs
254
+ cd child &&
255
+ test_must_fail git send-pack ../parent :refs/heads/master 2>errs
256
)
257
'
258
@@ -289,7 +290,7 @@ test_expect_success 'receive-pack de-dupes .have lines' '
290
EOF
291
292
GIT_TRACE_PACKET=$(pwd)/trace GIT_TEST_PROTOCOL_VERSION=0 \
292
- git push \
293
+ git push \
294
--receive-pack="unset GIT_TRACE_PACKET; git-receive-pack" \
295
fork HEAD:foo &&
296
extract_ref_advertisement <trace >refs &&
t/t5402-post-merge-hook.sh
+8
-8
@@ -15,7 +15,7 @@ test_expect_success setup '
15
git update-index a &&
16
tree1=$(git write-tree) &&
17
commit1=$(echo modify | git commit-tree $tree1 -p $commit0) &&
18
- git update-ref refs/heads/master $commit0 &&
18
+ git update-ref refs/heads/master $commit0 &&
19
git clone ./. clone1 &&
20
GIT_DIR=clone1/.git git update-index --add a &&
21
git clone ./. clone2 &&
@@ -23,34 +23,34 @@ test_expect_success setup '
23
'
24
25
for clone in 1 2; do
26
- cat >clone${clone}/.git/hooks/post-merge <<'EOF'
26
+ cat >clone${clone}/.git/hooks/post-merge <<'EOF'
27
#!/bin/sh
28
echo $@ >> $GIT_DIR/post-merge.args
29
EOF
30
- chmod u+x clone${clone}/.git/hooks/post-merge
30
+ chmod u+x clone${clone}/.git/hooks/post-merge
31
done
32
33
test_expect_success 'post-merge does not run for up-to-date ' '
34
- GIT_DIR=clone1/.git git merge $commit0 &&
34
+ GIT_DIR=clone1/.git git merge $commit0 &&
35
! test -f clone1/.git/post-merge.args
36
'
37
38
test_expect_success 'post-merge runs as expected ' '
39
- GIT_DIR=clone1/.git git merge $commit1 &&
39
+ GIT_DIR=clone1/.git git merge $commit1 &&
40
test -e clone1/.git/post-merge.args
41
'
42
43
test_expect_success 'post-merge from normal merge receives the right argument ' '
44
- grep 0 clone1/.git/post-merge.args
44
+ grep 0 clone1/.git/post-merge.args
45
'
46
47
test_expect_success 'post-merge from squash merge runs as expected ' '
48
- GIT_DIR=clone2/.git git merge --squash $commit1 &&
48
+ GIT_DIR=clone2/.git git merge --squash $commit1 &&
49
test -e clone2/.git/post-merge.args
50
'
51
52
test_expect_success 'post-merge from squash merge receives the right argument ' '
53
- grep 1 clone2/.git/post-merge.args
53
+ grep 1 clone2/.git/post-merge.args
54
'
55
56
test_done