Skip to content

Commit c2c6bcd

Browse files
committed
Merge branch 'bc/t5505-fix'
* bc/t5505-fix: t/t5505-remote.sh: escape * to prevent interpretation by shell as glob t5505: add missing && t5505: remove unnecessary subshell invocations
2 parents f40805b + 49de47c commit c2c6bcd

File tree

1 file changed

+6
-41
lines changed

1 file changed

+6
-41
lines changed

t/t5505-remote.sh

Lines changed: 6 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -110,17 +110,18 @@ test_expect_success 'remove remote' '
110110
test_expect_success 'remove remote protects non-remote branches' '
111111
(
112112
cd test &&
113-
(cat >expect1 <<EOF
113+
{ cat >expect1 <<EOF
114114
Note: A non-remote branch was not removed; to delete it, use:
115115
git branch -d master
116116
EOF
117-
cat >expect2 <<EOF
117+
} &&
118+
{ cat >expect2 <<EOF
118119
Note: Non-remote branches were not removed; to delete them, use:
119120
git branch -d foobranch
120121
git branch -d master
121122
EOF
122-
) &&
123-
git tag footag
123+
} &&
124+
git tag footag &&
124125
git config --add remote.oops.fetch "+refs/*:refs/*" &&
125126
git remote rm oops 2>actual1 &&
126127
git branch foobranch &&
@@ -534,55 +535,44 @@ test_expect_success 'show empty remote' '
534535
'
535536

536537
test_expect_success 'new remote' '
537-
(
538538
git remote add someremote foo &&
539539
echo foo >expect &&
540540
git config --get-all remote.someremote.url >actual &&
541541
cmp expect actual
542-
)
543542
'
544543

545544
test_expect_success 'remote set-url bar' '
546-
(
547545
git remote set-url someremote bar &&
548546
echo bar >expect &&
549547
git config --get-all remote.someremote.url >actual &&
550548
cmp expect actual
551-
)
552549
'
553550

554551
test_expect_success 'remote set-url baz bar' '
555-
(
556552
git remote set-url someremote baz bar &&
557553
echo baz >expect &&
558554
git config --get-all remote.someremote.url >actual &&
559555
cmp expect actual
560-
)
561556
'
562557

563558
test_expect_success 'remote set-url zot bar' '
564-
(
565559
test_must_fail git remote set-url someremote zot bar &&
566560
echo baz >expect &&
567561
git config --get-all remote.someremote.url >actual &&
568562
cmp expect actual
569-
)
570563
'
571564

572565
test_expect_success 'remote set-url --push zot baz' '
573-
(
574566
test_must_fail git remote set-url --push someremote zot baz &&
575567
echo "YYY" >expect &&
576568
echo baz >>expect &&
577569
test_must_fail git config --get-all remote.someremote.pushurl >actual &&
578570
echo "YYY" >>actual &&
579571
git config --get-all remote.someremote.url >>actual &&
580572
cmp expect actual
581-
)
582573
'
583574

584575
test_expect_success 'remote set-url --push zot' '
585-
(
586576
git remote set-url --push someremote zot &&
587577
echo zot >expect &&
588578
echo "YYY" >>expect &&
@@ -591,11 +581,9 @@ test_expect_success 'remote set-url --push zot' '
591581
echo "YYY" >>actual &&
592582
git config --get-all remote.someremote.url >>actual &&
593583
cmp expect actual
594-
)
595584
'
596585

597586
test_expect_success 'remote set-url --push qux zot' '
598-
(
599587
git remote set-url --push someremote qux zot &&
600588
echo qux >expect &&
601589
echo "YYY" >>expect &&
@@ -604,11 +592,9 @@ test_expect_success 'remote set-url --push qux zot' '
604592
echo "YYY" >>actual &&
605593
git config --get-all remote.someremote.url >>actual &&
606594
cmp expect actual
607-
)
608595
'
609596

610597
test_expect_success 'remote set-url --push foo qu+x' '
611-
(
612598
git remote set-url --push someremote foo qu+x &&
613599
echo foo >expect &&
614600
echo "YYY" >>expect &&
@@ -617,11 +603,9 @@ test_expect_success 'remote set-url --push foo qu+x' '
617603
echo "YYY" >>actual &&
618604
git config --get-all remote.someremote.url >>actual &&
619605
cmp expect actual
620-
)
621606
'
622607

623608
test_expect_success 'remote set-url --push --add aaa' '
624-
(
625609
git remote set-url --push --add someremote aaa &&
626610
echo foo >expect &&
627611
echo aaa >>expect &&
@@ -631,11 +615,9 @@ test_expect_success 'remote set-url --push --add aaa' '
631615
echo "YYY" >>actual &&
632616
git config --get-all remote.someremote.url >>actual &&
633617
cmp expect actual
634-
)
635618
'
636619

637620
test_expect_success 'remote set-url --push bar aaa' '
638-
(
639621
git remote set-url --push someremote bar aaa &&
640622
echo foo >expect &&
641623
echo bar >>expect &&
@@ -645,11 +627,9 @@ test_expect_success 'remote set-url --push bar aaa' '
645627
echo "YYY" >>actual &&
646628
git config --get-all remote.someremote.url >>actual &&
647629
cmp expect actual
648-
)
649630
'
650631

651632
test_expect_success 'remote set-url --push --delete bar' '
652-
(
653633
git remote set-url --push --delete someremote bar &&
654634
echo foo >expect &&
655635
echo "YYY" >>expect &&
@@ -658,23 +638,19 @@ test_expect_success 'remote set-url --push --delete bar' '
658638
echo "YYY" >>actual &&
659639
git config --get-all remote.someremote.url >>actual &&
660640
cmp expect actual
661-
)
662641
'
663642

664643
test_expect_success 'remote set-url --push --delete foo' '
665-
(
666644
git remote set-url --push --delete someremote foo &&
667645
echo "YYY" >expect &&
668646
echo baz >>expect &&
669647
test_must_fail git config --get-all remote.someremote.pushurl >actual &&
670648
echo "YYY" >>actual &&
671649
git config --get-all remote.someremote.url >>actual &&
672650
cmp expect actual
673-
)
674651
'
675652

676653
test_expect_success 'remote set-url --add bbb' '
677-
(
678654
git remote set-url --add someremote bbb &&
679655
echo "YYY" >expect &&
680656
echo baz >>expect &&
@@ -683,48 +659,40 @@ test_expect_success 'remote set-url --add bbb' '
683659
echo "YYY" >>actual &&
684660
git config --get-all remote.someremote.url >>actual &&
685661
cmp expect actual
686-
)
687662
'
688663

689664
test_expect_success 'remote set-url --delete .*' '
690-
(
691-
test_must_fail git remote set-url --delete someremote .* &&
665+
test_must_fail git remote set-url --delete someremote .\* &&
692666
echo "YYY" >expect &&
693667
echo baz >>expect &&
694668
echo bbb >>expect &&
695669
test_must_fail git config --get-all remote.someremote.pushurl >actual &&
696670
echo "YYY" >>actual &&
697671
git config --get-all remote.someremote.url >>actual &&
698672
cmp expect actual
699-
)
700673
'
701674

702675
test_expect_success 'remote set-url --delete bbb' '
703-
(
704676
git remote set-url --delete someremote bbb &&
705677
echo "YYY" >expect &&
706678
echo baz >>expect &&
707679
test_must_fail git config --get-all remote.someremote.pushurl >actual &&
708680
echo "YYY" >>actual &&
709681
git config --get-all remote.someremote.url >>actual &&
710682
cmp expect actual
711-
)
712683
'
713684

714685
test_expect_success 'remote set-url --delete baz' '
715-
(
716686
test_must_fail git remote set-url --delete someremote baz &&
717687
echo "YYY" >expect &&
718688
echo baz >>expect &&
719689
test_must_fail git config --get-all remote.someremote.pushurl >actual &&
720690
echo "YYY" >>actual &&
721691
git config --get-all remote.someremote.url >>actual &&
722692
cmp expect actual
723-
)
724693
'
725694

726695
test_expect_success 'remote set-url --add ccc' '
727-
(
728696
git remote set-url --add someremote ccc &&
729697
echo "YYY" >expect &&
730698
echo baz >>expect &&
@@ -733,19 +701,16 @@ test_expect_success 'remote set-url --add ccc' '
733701
echo "YYY" >>actual &&
734702
git config --get-all remote.someremote.url >>actual &&
735703
cmp expect actual
736-
)
737704
'
738705

739706
test_expect_success 'remote set-url --delete baz' '
740-
(
741707
git remote set-url --delete someremote baz &&
742708
echo "YYY" >expect &&
743709
echo ccc >>expect &&
744710
test_must_fail git config --get-all remote.someremote.pushurl >actual &&
745711
echo "YYY" >>actual &&
746712
git config --get-all remote.someremote.url >>actual &&
747713
cmp expect actual
748-
)
749714
'
750715

751716
test_done

0 commit comments

Comments
 (0)