Skip to content

Commit 6a0b88b

Browse files
ungpsgitster
authored andcommitted
t3903: modernize style
Remove whitespaces after redirection operators and wrap long lines. Signed-off-by: Paul-Sebastian Ungureanu <ungureanupaulsebastian@gmail.com> Signed-off-by: Thomas Gummerer <t.gummerer@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 93415f5 commit 6a0b88b

File tree

1 file changed

+61
-59
lines changed

1 file changed

+61
-59
lines changed

t/t3903-stash.sh

Lines changed: 61 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,22 @@ test_description='Test git stash'
88
. ./test-lib.sh
99

1010
test_expect_success 'stash some dirty working directory' '
11-
echo 1 > file &&
11+
echo 1 >file &&
1212
git add file &&
1313
echo unrelated >other-file &&
1414
git add other-file &&
1515
test_tick &&
1616
git commit -m initial &&
17-
echo 2 > file &&
17+
echo 2 >file &&
1818
git add file &&
19-
echo 3 > file &&
19+
echo 3 >file &&
2020
test_tick &&
2121
git stash &&
2222
git diff-files --quiet &&
2323
git diff-index --cached --quiet HEAD
2424
'
2525

26-
cat > expect << EOF
26+
cat >expect <<EOF
2727
diff --git a/file b/file
2828
index 0cfbf08..00750ed 100644
2929
--- a/file
@@ -35,7 +35,7 @@ EOF
3535

3636
test_expect_success 'parents of stash' '
3737
test $(git rev-parse stash^) = $(git rev-parse HEAD) &&
38-
git diff stash^2..stash > output &&
38+
git diff stash^2..stash >output &&
3939
test_cmp expect output
4040
'
4141

@@ -74,7 +74,7 @@ test_expect_success 'apply stashed changes' '
7474

7575
test_expect_success 'apply stashed changes (including index)' '
7676
git reset --hard HEAD^ &&
77-
echo 6 > other-file &&
77+
echo 6 >other-file &&
7878
git add other-file &&
7979
test_tick &&
8080
git commit -m other-file &&
@@ -99,12 +99,12 @@ test_expect_success 'stash drop complains of extra options' '
9999

100100
test_expect_success 'drop top stash' '
101101
git reset --hard &&
102-
git stash list > stashlist1 &&
103-
echo 7 > file &&
102+
git stash list >expected &&
103+
echo 7 >file &&
104104
git stash &&
105105
git stash drop &&
106-
git stash list > stashlist2 &&
107-
test_cmp stashlist1 stashlist2 &&
106+
git stash list >actual &&
107+
test_cmp expected actual &&
108108
git stash apply &&
109109
test 3 = $(cat file) &&
110110
test 1 = $(git show :file) &&
@@ -113,9 +113,9 @@ test_expect_success 'drop top stash' '
113113

114114
test_expect_success 'drop middle stash' '
115115
git reset --hard &&
116-
echo 8 > file &&
116+
echo 8 >file &&
117117
git stash &&
118-
echo 9 > file &&
118+
echo 9 >file &&
119119
git stash &&
120120
git stash drop stash@{1} &&
121121
test 2 = $(git stash list | wc -l) &&
@@ -160,7 +160,7 @@ test_expect_success 'stash pop' '
160160
test 0 = $(git stash list | wc -l)
161161
'
162162

163-
cat > expect << EOF
163+
cat >expect <<EOF
164164
diff --git a/file2 b/file2
165165
new file mode 100644
166166
index 0000000..1fe912c
@@ -170,7 +170,7 @@ index 0000000..1fe912c
170170
+bar2
171171
EOF
172172

173-
cat > expect1 << EOF
173+
cat >expect1 <<EOF
174174
diff --git a/file b/file
175175
index 257cc56..5716ca5 100644
176176
--- a/file
@@ -180,7 +180,7 @@ index 257cc56..5716ca5 100644
180180
+bar
181181
EOF
182182

183-
cat > expect2 << EOF
183+
cat >expect2 <<EOF
184184
diff --git a/file b/file
185185
index 7601807..5716ca5 100644
186186
--- a/file
@@ -198,79 +198,79 @@ index 0000000..1fe912c
198198
EOF
199199

200200
test_expect_success 'stash branch' '
201-
echo foo > file &&
201+
echo foo >file &&
202202
git commit file -m first &&
203-
echo bar > file &&
204-
echo bar2 > file2 &&
203+
echo bar >file &&
204+
echo bar2 >file2 &&
205205
git add file2 &&
206206
git stash &&
207-
echo baz > file &&
207+
echo baz >file &&
208208
git commit file -m second &&
209209
git stash branch stashbranch &&
210210
test refs/heads/stashbranch = $(git symbolic-ref HEAD) &&
211211
test $(git rev-parse HEAD) = $(git rev-parse master^) &&
212-
git diff --cached > output &&
212+
git diff --cached >output &&
213213
test_cmp expect output &&
214-
git diff > output &&
214+
git diff >output &&
215215
test_cmp expect1 output &&
216216
git add file &&
217217
git commit -m alternate\ second &&
218-
git diff master..stashbranch > output &&
218+
git diff master..stashbranch >output &&
219219
test_cmp output expect2 &&
220220
test 0 = $(git stash list | wc -l)
221221
'
222222

223223
test_expect_success 'apply -q is quiet' '
224-
echo foo > file &&
224+
echo foo >file &&
225225
git stash &&
226-
git stash apply -q > output.out 2>&1 &&
226+
git stash apply -q >output.out 2>&1 &&
227227
test_must_be_empty output.out
228228
'
229229

230230
test_expect_success 'save -q is quiet' '
231-
git stash save --quiet > output.out 2>&1 &&
231+
git stash save --quiet >output.out 2>&1 &&
232232
test_must_be_empty output.out
233233
'
234234

235235
test_expect_success 'pop -q is quiet' '
236-
git stash pop -q > output.out 2>&1 &&
236+
git stash pop -q >output.out 2>&1 &&
237237
test_must_be_empty output.out
238238
'
239239

240240
test_expect_success 'pop -q --index works and is quiet' '
241-
echo foo > file &&
241+
echo foo >file &&
242242
git add file &&
243243
git stash save --quiet &&
244-
git stash pop -q --index > output.out 2>&1 &&
244+
git stash pop -q --index >output.out 2>&1 &&
245245
test foo = "$(git show :file)" &&
246246
test_must_be_empty output.out
247247
'
248248

249249
test_expect_success 'drop -q is quiet' '
250250
git stash &&
251-
git stash drop -q > output.out 2>&1 &&
251+
git stash drop -q >output.out 2>&1 &&
252252
test_must_be_empty output.out
253253
'
254254

255255
test_expect_success 'stash -k' '
256-
echo bar3 > file &&
257-
echo bar4 > file2 &&
256+
echo bar3 >file &&
257+
echo bar4 >file2 &&
258258
git add file2 &&
259259
git stash -k &&
260260
test bar,bar4 = $(cat file),$(cat file2)
261261
'
262262

263263
test_expect_success 'stash --no-keep-index' '
264-
echo bar33 > file &&
265-
echo bar44 > file2 &&
264+
echo bar33 >file &&
265+
echo bar44 >file2 &&
266266
git add file2 &&
267267
git stash --no-keep-index &&
268268
test bar,bar2 = $(cat file),$(cat file2)
269269
'
270270

271271
test_expect_success 'stash --invalid-option' '
272-
echo bar5 > file &&
273-
echo bar6 > file2 &&
272+
echo bar5 >file &&
273+
echo bar6 >file2 &&
274274
git add file2 &&
275275
test_must_fail git stash --invalid-option &&
276276
test_must_fail git stash save --invalid-option &&
@@ -486,26 +486,28 @@ test_expect_success 'stash branch - no stashes on stack, stash-like argument' '
486486
git stash clear &&
487487
test_when_finished "git reset --hard HEAD" &&
488488
git reset --hard &&
489-
echo foo >> file &&
489+
echo foo >>file &&
490490
STASH_ID=$(git stash create) &&
491491
git reset --hard &&
492492
git stash branch stash-branch ${STASH_ID} &&
493-
test_when_finished "git reset --hard HEAD && git checkout master && git branch -D stash-branch" &&
493+
test_when_finished "git reset --hard HEAD && git checkout master &&
494+
git branch -D stash-branch" &&
494495
test $(git ls-files --modified | wc -l) -eq 1
495496
'
496497

497498
test_expect_success 'stash branch - stashes on stack, stash-like argument' '
498499
git stash clear &&
499500
test_when_finished "git reset --hard HEAD" &&
500501
git reset --hard &&
501-
echo foo >> file &&
502+
echo foo >>file &&
502503
git stash &&
503504
test_when_finished "git stash drop" &&
504-
echo bar >> file &&
505+
echo bar >>file &&
505506
STASH_ID=$(git stash create) &&
506507
git reset --hard &&
507508
git stash branch stash-branch ${STASH_ID} &&
508-
test_when_finished "git reset --hard HEAD && git checkout master && git branch -D stash-branch" &&
509+
test_when_finished "git reset --hard HEAD && git checkout master &&
510+
git branch -D stash-branch" &&
509511
test $(git ls-files --modified | wc -l) -eq 1
510512
'
511513

@@ -518,10 +520,10 @@ test_expect_success 'stash show format defaults to --stat' '
518520
git stash clear &&
519521
test_when_finished "git reset --hard HEAD" &&
520522
git reset --hard &&
521-
echo foo >> file &&
523+
echo foo >>file &&
522524
git stash &&
523525
test_when_finished "git stash drop" &&
524-
echo bar >> file &&
526+
echo bar >>file &&
525527
STASH_ID=$(git stash create) &&
526528
git reset --hard &&
527529
cat >expected <<-EOF &&
@@ -536,10 +538,10 @@ test_expect_success 'stash show - stashes on stack, stash-like argument' '
536538
git stash clear &&
537539
test_when_finished "git reset --hard HEAD" &&
538540
git reset --hard &&
539-
echo foo >> file &&
541+
echo foo >>file &&
540542
git stash &&
541543
test_when_finished "git stash drop" &&
542-
echo bar >> file &&
544+
echo bar >>file &&
543545
STASH_ID=$(git stash create) &&
544546
git reset --hard &&
545547
echo "1 0 file" >expected &&
@@ -551,10 +553,10 @@ test_expect_success 'stash show -p - stashes on stack, stash-like argument' '
551553
git stash clear &&
552554
test_when_finished "git reset --hard HEAD" &&
553555
git reset --hard &&
554-
echo foo >> file &&
556+
echo foo >>file &&
555557
git stash &&
556558
test_when_finished "git stash drop" &&
557-
echo bar >> file &&
559+
echo bar >>file &&
558560
STASH_ID=$(git stash create) &&
559561
git reset --hard &&
560562
cat >expected <<-EOF &&
@@ -574,7 +576,7 @@ test_expect_success 'stash show - no stashes on stack, stash-like argument' '
574576
git stash clear &&
575577
test_when_finished "git reset --hard HEAD" &&
576578
git reset --hard &&
577-
echo foo >> file &&
579+
echo foo >>file &&
578580
STASH_ID=$(git stash create) &&
579581
git reset --hard &&
580582
echo "1 0 file" >expected &&
@@ -586,7 +588,7 @@ test_expect_success 'stash show -p - no stashes on stack, stash-like argument' '
586588
git stash clear &&
587589
test_when_finished "git reset --hard HEAD" &&
588590
git reset --hard &&
589-
echo foo >> file &&
591+
echo foo >>file &&
590592
STASH_ID=$(git stash create) &&
591593
git reset --hard &&
592594
cat >expected <<-EOF &&
@@ -606,9 +608,9 @@ test_expect_success 'stash drop - fail early if specified stash is not a stash r
606608
git stash clear &&
607609
test_when_finished "git reset --hard HEAD && git stash clear" &&
608610
git reset --hard &&
609-
echo foo > file &&
611+
echo foo >file &&
610612
git stash &&
611-
echo bar > file &&
613+
echo bar >file &&
612614
git stash &&
613615
test_must_fail git stash drop $(git rev-parse stash@{0}) &&
614616
git stash pop &&
@@ -620,9 +622,9 @@ test_expect_success 'stash pop - fail early if specified stash is not a stash re
620622
git stash clear &&
621623
test_when_finished "git reset --hard HEAD && git stash clear" &&
622624
git reset --hard &&
623-
echo foo > file &&
625+
echo foo >file &&
624626
git stash &&
625-
echo bar > file &&
627+
echo bar >file &&
626628
git stash &&
627629
test_must_fail git stash pop $(git rev-parse stash@{0}) &&
628630
git stash pop &&
@@ -632,8 +634,8 @@ test_expect_success 'stash pop - fail early if specified stash is not a stash re
632634

633635
test_expect_success 'ref with non-existent reflog' '
634636
git stash clear &&
635-
echo bar5 > file &&
636-
echo bar6 > file2 &&
637+
echo bar5 >file &&
638+
echo bar6 >file2 &&
637639
git add file2 &&
638640
git stash &&
639641
test_must_fail git rev-parse --quiet --verify does-not-exist &&
@@ -653,8 +655,8 @@ test_expect_success 'ref with non-existent reflog' '
653655
test_expect_success 'invalid ref of the form stash@{n}, n >= N' '
654656
git stash clear &&
655657
test_must_fail git stash drop stash@{0} &&
656-
echo bar5 > file &&
657-
echo bar6 > file2 &&
658+
echo bar5 >file &&
659+
echo bar6 >file2 &&
658660
git add file2 &&
659661
git stash &&
660662
test_must_fail git stash drop stash@{1} &&
@@ -724,7 +726,7 @@ test_expect_success 'stash apply shows status same as git status (relative to cu
724726
test_i18ncmp expect actual
725727
'
726728

727-
cat > expect << EOF
729+
cat >expect <<EOF
728730
diff --git a/HEAD b/HEAD
729731
new file mode 100644
730732
index 0000000..fe0cbee
@@ -737,14 +739,14 @@ EOF
737739
test_expect_success 'stash where working directory contains "HEAD" file' '
738740
git stash clear &&
739741
git reset --hard &&
740-
echo file-not-a-ref > HEAD &&
742+
echo file-not-a-ref >HEAD &&
741743
git add HEAD &&
742744
test_tick &&
743745
git stash &&
744746
git diff-files --quiet &&
745747
git diff-index --cached --quiet HEAD &&
746748
test "$(git rev-parse stash^)" = "$(git rev-parse HEAD)" &&
747-
git diff stash^..stash > output &&
749+
git diff stash^..stash >output &&
748750
test_cmp expect output
749751
'
750752

0 commit comments

Comments
 (0)