Skip to content

Commit 1e8ed50

Browse files
committed
Merge branch 'js/test-whitespace-fixes'
Test code clean-up. * js/test-whitespace-fixes: t9603: use tabs for indentation t5570: remove trailing padding t5400,t5402: consistently indent with tabs, not with spaces t3427: adjust stale comment t3406: indent with tabs, not spaces t1004: insert missing "branch" in a message
2 parents 8d9e92b + f6bcd9a commit 1e8ed50

7 files changed

+113
-112
lines changed

t/t1004-read-tree-m-u-wf.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ test_expect_success 'two-way setup' '
2020
git branch side &&
2121
git tag -f branch-point &&
2222
23-
echo file2 is not tracked on the master anymore &&
23+
echo file2 is not tracked on the master branch anymore &&
2424
rm -f file2 subdir/file2 &&
2525
git update-index --remove file2 subdir/file2 &&
2626
git commit -a -m "master removes file2 and subdir/file2"

t/t3406-rebase-message.sh

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,22 +46,22 @@ test_expect_success 'rebase fast-forward to master' '
4646

4747
test_expect_success 'rebase --stat' '
4848
git reset --hard start &&
49-
git rebase --stat master >diffstat.txt &&
50-
grep "^ fileX | *1 +$" diffstat.txt
49+
git rebase --stat master >diffstat.txt &&
50+
grep "^ fileX | *1 +$" diffstat.txt
5151
'
5252

5353
test_expect_success 'rebase w/config rebase.stat' '
5454
git reset --hard start &&
55-
git config rebase.stat true &&
56-
git rebase master >diffstat.txt &&
57-
grep "^ fileX | *1 +$" diffstat.txt
55+
git config rebase.stat true &&
56+
git rebase master >diffstat.txt &&
57+
grep "^ fileX | *1 +$" diffstat.txt
5858
'
5959

6060
test_expect_success 'rebase -n overrides config rebase.stat config' '
6161
git reset --hard start &&
62-
git config rebase.stat true &&
63-
git rebase -n master >diffstat.txt &&
64-
! grep "^ fileX | *1 +$" diffstat.txt
62+
git config rebase.stat true &&
63+
git rebase -n master >diffstat.txt &&
64+
! grep "^ fileX | *1 +$" diffstat.txt
6565
'
6666

6767
# Output to stderr:

t/t3427-rebase-subtree.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ commit_message() {
1919
# \
2020
# README ---------------------- Add subproject master - topic_4 - files_subtree/topic_5
2121
#
22-
# Where the merge moves the files master[123].t into the subdirectory
22+
# Where the merge moves the files topic_[123].t into the subdirectory
2323
# files_subtree/ and topic_4 as well as files_subtree/topic_5 add files to that
2424
# directory directly.
2525
#

t/t5400-send-pack.sh

Lines changed: 77 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,15 @@ test_expect_success setup '
2121
i=0 &&
2222
while test $i -le $cnt
2323
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
3233
done &&
3334
git update-ref HEAD "$commit" &&
3435
git clone ./. victim &&
@@ -38,14 +39,14 @@ test_expect_success setup '
3839
i=0 &&
3940
while test $i -le $cnt
4041
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
4950
done &&
5051
git update-ref HEAD "$commit" &&
5152
echo Rebase &&
@@ -57,11 +58,11 @@ test_expect_success 'pack the source repository' '
5758
'
5859

5960
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+
)
6566
'
6667

6768
test_expect_success 'refuse pushing rewound head without --force' '
@@ -85,10 +86,10 @@ test_expect_success 'push can be used to delete a ref' '
8586

8687
test_expect_success 'refuse deleting push with denyDeletes' '
8788
(
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
9293
) &&
9394
test_must_fail git send-pack ./victim :extra master
9495
'
@@ -118,9 +119,9 @@ test_expect_success 'override denyDeletes with git -c receive-pack' '
118119

119120
test_expect_success 'denyNonFastforwards trumps --force' '
120121
(
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
124125
) &&
125126
victim_orig=$(cd victim && git rev-parse --verify master) &&
126127
test_must_fail git send-pack --force ./victim master^:master &&
@@ -143,50 +144,50 @@ test_expect_success 'send-pack --all sends all branches' '
143144
test_expect_success 'push --all excludes remote-tracking hierarchy' '
144145
mkdir parent &&
145146
(
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
148149
) &&
149150
git clone parent child &&
150151
(
151-
cd child && git push --all
152+
cd child && git push --all
152153
) &&
153154
(
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)"
156157
)
157158
'
158159

159160
test_expect_success 'receive-pack runs auto-gc in remote repo' '
160161
rm -rf parent child &&
161162
git init parent &&
162163
(
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
172173
) &&
173174
cp -R parent child &&
174175
(
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
184185
) &&
185186
(
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
190191
) &&
191192
test ! -e child/.git/objects/tmp_test_object
192193
'
@@ -195,32 +196,32 @@ rewound_push_setup() {
195196
rm -rf parent child &&
196197
mkdir parent &&
197198
(
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
203204
) &&
204205
git clone parent child &&
205206
(
206-
cd child && git reset --hard HEAD^
207+
cd child && git reset --hard HEAD^
207208
)
208209
}
209210

210211
test_expect_success 'pushing explicit refspecs respects forcing' '
211212
rewound_push_setup &&
212213
parent_orig=$(cd parent && git rev-parse --verify master) &&
213214
(
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
217218
) &&
218219
parent_head=$(cd parent && git rev-parse --verify master) &&
219220
test "$parent_orig" = "$parent_head" &&
220221
(
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
224225
) &&
225226
parent_head=$(cd parent && git rev-parse --verify master) &&
226227
child_head=$(cd child && git rev-parse --verify master) &&
@@ -231,16 +232,16 @@ test_expect_success 'pushing wildcard refspecs respects forcing' '
231232
rewound_push_setup &&
232233
parent_orig=$(cd parent && git rev-parse --verify master) &&
233234
(
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/*"
237238
) &&
238239
parent_head=$(cd parent && git rev-parse --verify master) &&
239240
test "$parent_orig" = "$parent_head" &&
240241
(
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/*"
244245
) &&
245246
parent_head=$(cd parent && git rev-parse --verify master) &&
246247
child_head=$(cd child && git rev-parse --verify master) &&
@@ -250,8 +251,8 @@ test_expect_success 'pushing wildcard refspecs respects forcing' '
250251
test_expect_success 'deny pushing to delete current branch' '
251252
rewound_push_setup &&
252253
(
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
255256
)
256257
'
257258

@@ -289,7 +290,7 @@ test_expect_success 'receive-pack de-dupes .have lines' '
289290
EOF
290291
291292
GIT_TRACE_PACKET=$(pwd)/trace GIT_TEST_PROTOCOL_VERSION=0 \
292-
git push \
293+
git push \
293294
--receive-pack="unset GIT_TRACE_PACKET; git-receive-pack" \
294295
fork HEAD:foo &&
295296
extract_ref_advertisement <trace >refs &&

t/t5402-post-merge-hook.sh

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,42 +15,42 @@ test_expect_success setup '
1515
git update-index a &&
1616
tree1=$(git write-tree) &&
1717
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 &&
1919
git clone ./. clone1 &&
2020
GIT_DIR=clone1/.git git update-index --add a &&
2121
git clone ./. clone2 &&
2222
GIT_DIR=clone2/.git git update-index --add a
2323
'
2424

2525
for clone in 1 2; do
26-
cat >clone${clone}/.git/hooks/post-merge <<'EOF'
26+
cat >clone${clone}/.git/hooks/post-merge <<'EOF'
2727
#!/bin/sh
2828
echo $@ >> $GIT_DIR/post-merge.args
2929
EOF
30-
chmod u+x clone${clone}/.git/hooks/post-merge
30+
chmod u+x clone${clone}/.git/hooks/post-merge
3131
done
3232

3333
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 &&
3535
! test -f clone1/.git/post-merge.args
3636
'
3737

3838
test_expect_success 'post-merge runs as expected ' '
39-
GIT_DIR=clone1/.git git merge $commit1 &&
39+
GIT_DIR=clone1/.git git merge $commit1 &&
4040
test -e clone1/.git/post-merge.args
4141
'
4242

4343
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
4545
'
4646

4747
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 &&
4949
test -e clone2/.git/post-merge.args
5050
'
5151

5252
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
5454
'
5555

5656
test_done

t/t5570-git-daemon.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -147,18 +147,18 @@ test_remote_error()
147147
}
148148

149149
msg="access denied or repository not exported"
150-
test_expect_success 'clone non-existent' "test_remote_error '$msg' clone nowhere.git "
150+
test_expect_success 'clone non-existent' "test_remote_error '$msg' clone nowhere.git"
151151
test_expect_success 'push disabled' "test_remote_error '$msg' push repo.git master"
152-
test_expect_success 'read access denied' "test_remote_error -x '$msg' fetch repo.git "
153-
test_expect_success 'not exported' "test_remote_error -n '$msg' fetch repo.git "
152+
test_expect_success 'read access denied' "test_remote_error -x '$msg' fetch repo.git"
153+
test_expect_success 'not exported' "test_remote_error -n '$msg' fetch repo.git"
154154

155155
stop_git_daemon
156156
start_git_daemon --informative-errors
157157

158-
test_expect_success 'clone non-existent' "test_remote_error 'no such repository' clone nowhere.git "
158+
test_expect_success 'clone non-existent' "test_remote_error 'no such repository' clone nowhere.git"
159159
test_expect_success 'push disabled' "test_remote_error 'service not enabled' push repo.git master"
160-
test_expect_success 'read access denied' "test_remote_error -x 'no such repository' fetch repo.git "
161-
test_expect_success 'not exported' "test_remote_error -n 'repository not exported' fetch repo.git "
160+
test_expect_success 'read access denied' "test_remote_error -x 'no such repository' fetch repo.git"
161+
test_expect_success 'not exported' "test_remote_error -n 'repository not exported' fetch repo.git"
162162

163163
stop_git_daemon
164164
start_git_daemon --interpolated-path="$GIT_DAEMON_DOCUMENT_ROOT_PATH/%H%D"

0 commit comments

Comments
 (0)