1588
EOF
1589
'
1590
1591
+#TODO: -c/-C argument completion should not include all references
1592
+test_expect_failure 'git switch - for -c, complete local branches and unique remote branches' '
1593
+ test_completion "git switch -c " <<-\EOF
1594
+ branch-in-other Z
1595
+ master Z
1596
+ master-in-other Z
1597
+ matching-branch Z
1598
+ EOF
1599
+'
1600
+
1601
+#TODO: -c/-C argument completion should not include all references
1602
+test_expect_failure 'git switch - for -C, complete local branches and unique remote branches' '
1603
+ test_completion "git switch -C " <<-\EOF
1604
+ branch-in-other Z
1605
+ master Z
1606
+ master-in-other Z
1607
+ matching-branch Z
1608
+ EOF
1609
+'
1610
+
1611
+test_expect_success 'git switch - for -c with --no-guess, complete local branches only' '
1612
+ test_completion "git switch --no-guess -c " <<-\EOF
1613
+ master Z
1614
+ matching-branch Z
1615
+ EOF
1616
+'
1617
+
1618
+test_expect_success 'git switch - for -C with --no-guess, complete local branches only' '
1619
+ test_completion "git switch --no-guess -C " <<-\EOF
1620
+ master Z
1621
+ matching-branch Z
1622
+ EOF
1623
+'
1624
+
1625
+test_expect_success 'git switch - for -c with --no-track, complete local branches only' '
1626
+ test_completion "git switch --no-track -c " <<-\EOF
1627
+ master Z
1628
+ matching-branch Z
1629
+ EOF
1630
+'
1631
+
1632
+test_expect_success 'git switch - for -C with --no-track, complete local branches only' '
1633
+ test_completion "git switch --no-track -C " <<-\EOF
1634
+ master Z
1635
+ matching-branch Z
1636
+ EOF
1637
+'
1638
+
1639
+#TODO: -b/-B argument completion should not include all references
1640
+test_expect_failure 'git checkout - for -b, complete local branches and unique remote branches' '
1641
+ test_completion "git checkout -b " <<-\EOF
1642
+ branch-in-other Z
1643
+ master Z
1644
+ master-in-other Z
1645
+ matching-branch Z
1646
+ EOF
1647
+'
1648
+
1649
+#TODO: -b/-B argument completion should not include all references
1650
+test_expect_failure 'git checkout - for -B, complete local branches and unique remote branches' '
1651
+ test_completion "git checkout -B " <<-\EOF
1652
+ branch-in-other Z
1653
+ master Z
1654
+ master-in-other Z
1655
+ matching-branch Z
1656
+ EOF
1657
+'
1658
+
1659
+#TODO: -b/-B argument completion should not include all references
1660
+test_expect_failure 'git checkout - for -b with --no-guess, complete local branches only' '
1661
+ test_completion "git checkout --no-guess -b " <<-\EOF
1662
+ master Z
1663
+ matching-branch Z
1664
+ EOF
1665
+'
1666
+
1667
+#TODO: -b/-B argument completion should not include all references
1668
+test_expect_failure 'git checkout - for -B with --no-guess, complete local branches only' '
1669
+ test_completion "git checkout --no-guess -B " <<-\EOF
1670
+ master Z
1671
+ matching-branch Z
1672
+ EOF
1673
+'
1674
+
1675
+#TODO: -b/-B argument completion should not include all references
1676
+test_expect_failure 'git checkout - for -b with --no-track, complete local branches only' '
1677
+ test_completion "git checkout --no-track -b " <<-\EOF
1678
+ master Z
1679
+ matching-branch Z
1680
+ EOF
1681
+'
1682
+
1683
+#TODO: -b/-B argument completion should not include all references
1684
+test_expect_failure 'git checkout - for -B with --no-track, complete local branches only' '
1685
+ test_completion "git checkout --no-track -B " <<-\EOF
1686
+ master Z
1687
+ matching-branch Z
1688
+ EOF
1689
+'
1690
+
1691
test_expect_success 'teardown after ref completion' '
1692
git branch -d matching-branch &&
1693
git tag -d matching-tag &&