@@ -110,17 +110,18 @@ test_expect_success 'remove remote' '
110
110
test_expect_success ' remove remote protects non-remote branches' '
111
111
(
112
112
cd test &&
113
- ( cat >expect1 <<EOF
113
+ { cat >expect1 <<EOF
114
114
Note: A non-remote branch was not removed; to delete it, use:
115
115
git branch -d master
116
116
EOF
117
- cat >expect2 <<EOF
117
+ } &&
118
+ { cat >expect2 <<EOF
118
119
Note: Non-remote branches were not removed; to delete them, use:
119
120
git branch -d foobranch
120
121
git branch -d master
121
122
EOF
122
- ) &&
123
- git tag footag
123
+ } &&
124
+ git tag footag &&
124
125
git config --add remote.oops.fetch "+refs/*:refs/*" &&
125
126
git remote rm oops 2>actual1 &&
126
127
git branch foobranch &&
@@ -534,55 +535,44 @@ test_expect_success 'show empty remote' '
534
535
'
535
536
536
537
test_expect_success ' new remote' '
537
- (
538
538
git remote add someremote foo &&
539
539
echo foo >expect &&
540
540
git config --get-all remote.someremote.url >actual &&
541
541
cmp expect actual
542
- )
543
542
'
544
543
545
544
test_expect_success ' remote set-url bar' '
546
- (
547
545
git remote set-url someremote bar &&
548
546
echo bar >expect &&
549
547
git config --get-all remote.someremote.url >actual &&
550
548
cmp expect actual
551
- )
552
549
'
553
550
554
551
test_expect_success ' remote set-url baz bar' '
555
- (
556
552
git remote set-url someremote baz bar &&
557
553
echo baz >expect &&
558
554
git config --get-all remote.someremote.url >actual &&
559
555
cmp expect actual
560
- )
561
556
'
562
557
563
558
test_expect_success ' remote set-url zot bar' '
564
- (
565
559
test_must_fail git remote set-url someremote zot bar &&
566
560
echo baz >expect &&
567
561
git config --get-all remote.someremote.url >actual &&
568
562
cmp expect actual
569
- )
570
563
'
571
564
572
565
test_expect_success ' remote set-url --push zot baz' '
573
- (
574
566
test_must_fail git remote set-url --push someremote zot baz &&
575
567
echo "YYY" >expect &&
576
568
echo baz >>expect &&
577
569
test_must_fail git config --get-all remote.someremote.pushurl >actual &&
578
570
echo "YYY" >>actual &&
579
571
git config --get-all remote.someremote.url >>actual &&
580
572
cmp expect actual
581
- )
582
573
'
583
574
584
575
test_expect_success ' remote set-url --push zot' '
585
- (
586
576
git remote set-url --push someremote zot &&
587
577
echo zot >expect &&
588
578
echo "YYY" >>expect &&
@@ -591,11 +581,9 @@ test_expect_success 'remote set-url --push zot' '
591
581
echo "YYY" >>actual &&
592
582
git config --get-all remote.someremote.url >>actual &&
593
583
cmp expect actual
594
- )
595
584
'
596
585
597
586
test_expect_success ' remote set-url --push qux zot' '
598
- (
599
587
git remote set-url --push someremote qux zot &&
600
588
echo qux >expect &&
601
589
echo "YYY" >>expect &&
@@ -604,11 +592,9 @@ test_expect_success 'remote set-url --push qux zot' '
604
592
echo "YYY" >>actual &&
605
593
git config --get-all remote.someremote.url >>actual &&
606
594
cmp expect actual
607
- )
608
595
'
609
596
610
597
test_expect_success ' remote set-url --push foo qu+x' '
611
- (
612
598
git remote set-url --push someremote foo qu+x &&
613
599
echo foo >expect &&
614
600
echo "YYY" >>expect &&
@@ -617,11 +603,9 @@ test_expect_success 'remote set-url --push foo qu+x' '
617
603
echo "YYY" >>actual &&
618
604
git config --get-all remote.someremote.url >>actual &&
619
605
cmp expect actual
620
- )
621
606
'
622
607
623
608
test_expect_success ' remote set-url --push --add aaa' '
624
- (
625
609
git remote set-url --push --add someremote aaa &&
626
610
echo foo >expect &&
627
611
echo aaa >>expect &&
@@ -631,11 +615,9 @@ test_expect_success 'remote set-url --push --add aaa' '
631
615
echo "YYY" >>actual &&
632
616
git config --get-all remote.someremote.url >>actual &&
633
617
cmp expect actual
634
- )
635
618
'
636
619
637
620
test_expect_success ' remote set-url --push bar aaa' '
638
- (
639
621
git remote set-url --push someremote bar aaa &&
640
622
echo foo >expect &&
641
623
echo bar >>expect &&
@@ -645,11 +627,9 @@ test_expect_success 'remote set-url --push bar aaa' '
645
627
echo "YYY" >>actual &&
646
628
git config --get-all remote.someremote.url >>actual &&
647
629
cmp expect actual
648
- )
649
630
'
650
631
651
632
test_expect_success ' remote set-url --push --delete bar' '
652
- (
653
633
git remote set-url --push --delete someremote bar &&
654
634
echo foo >expect &&
655
635
echo "YYY" >>expect &&
@@ -658,23 +638,19 @@ test_expect_success 'remote set-url --push --delete bar' '
658
638
echo "YYY" >>actual &&
659
639
git config --get-all remote.someremote.url >>actual &&
660
640
cmp expect actual
661
- )
662
641
'
663
642
664
643
test_expect_success ' remote set-url --push --delete foo' '
665
- (
666
644
git remote set-url --push --delete someremote foo &&
667
645
echo "YYY" >expect &&
668
646
echo baz >>expect &&
669
647
test_must_fail git config --get-all remote.someremote.pushurl >actual &&
670
648
echo "YYY" >>actual &&
671
649
git config --get-all remote.someremote.url >>actual &&
672
650
cmp expect actual
673
- )
674
651
'
675
652
676
653
test_expect_success ' remote set-url --add bbb' '
677
- (
678
654
git remote set-url --add someremote bbb &&
679
655
echo "YYY" >expect &&
680
656
echo baz >>expect &&
@@ -683,48 +659,40 @@ test_expect_success 'remote set-url --add bbb' '
683
659
echo "YYY" >>actual &&
684
660
git config --get-all remote.someremote.url >>actual &&
685
661
cmp expect actual
686
- )
687
662
'
688
663
689
664
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 .\* &&
692
666
echo "YYY" >expect &&
693
667
echo baz >>expect &&
694
668
echo bbb >>expect &&
695
669
test_must_fail git config --get-all remote.someremote.pushurl >actual &&
696
670
echo "YYY" >>actual &&
697
671
git config --get-all remote.someremote.url >>actual &&
698
672
cmp expect actual
699
- )
700
673
'
701
674
702
675
test_expect_success ' remote set-url --delete bbb' '
703
- (
704
676
git remote set-url --delete someremote bbb &&
705
677
echo "YYY" >expect &&
706
678
echo baz >>expect &&
707
679
test_must_fail git config --get-all remote.someremote.pushurl >actual &&
708
680
echo "YYY" >>actual &&
709
681
git config --get-all remote.someremote.url >>actual &&
710
682
cmp expect actual
711
- )
712
683
'
713
684
714
685
test_expect_success ' remote set-url --delete baz' '
715
- (
716
686
test_must_fail git remote set-url --delete someremote baz &&
717
687
echo "YYY" >expect &&
718
688
echo baz >>expect &&
719
689
test_must_fail git config --get-all remote.someremote.pushurl >actual &&
720
690
echo "YYY" >>actual &&
721
691
git config --get-all remote.someremote.url >>actual &&
722
692
cmp expect actual
723
- )
724
693
'
725
694
726
695
test_expect_success ' remote set-url --add ccc' '
727
- (
728
696
git remote set-url --add someremote ccc &&
729
697
echo "YYY" >expect &&
730
698
echo baz >>expect &&
@@ -733,19 +701,16 @@ test_expect_success 'remote set-url --add ccc' '
733
701
echo "YYY" >>actual &&
734
702
git config --get-all remote.someremote.url >>actual &&
735
703
cmp expect actual
736
- )
737
704
'
738
705
739
706
test_expect_success ' remote set-url --delete baz' '
740
- (
741
707
git remote set-url --delete someremote baz &&
742
708
echo "YYY" >expect &&
743
709
echo ccc >>expect &&
744
710
test_must_fail git config --get-all remote.someremote.pushurl >actual &&
745
711
echo "YYY" >>actual &&
746
712
git config --get-all remote.someremote.url >>actual &&
747
713
cmp expect actual
748
- )
749
714
'
750
715
751
716
test_done
0 commit comments