Git fork

completion: fix bugs with slashes in remote names

Previously, some calls to for-each-ref passed fixed numbers of path
components to strip from refs, assuming that remote names had no slashes
in them. This made completions like:

git push github/dseomn :com<Tab>

Result in:

git push github/dseomn :dseomn/completion-remote-slash

With this patch, it instead results in:

git push github/dseomn :completion-remote-slash

Signed-off-by: David Mandelberg <david@mandelberg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

authored by

David Mandelberg and committed by
Junio C Hamano
778d2f17 5637bdc3

+189 -29
+31 -7
contrib/completion/git-completion.bash
··· 790 790 __git_dwim_remote_heads () 791 791 { 792 792 local pfx="${1-}" cur_="${2-}" sfx="${3-}" 793 - local fer_pfx="${pfx//\%/%%}" # "escape" for-each-ref format specifiers 794 793 795 794 # employ the heuristic used by git checkout and git switch 796 795 # Try to find a remote branch that cur_es the completion word 797 796 # but only output if the branch name is unique 798 - __git for-each-ref --format="$fer_pfx%(refname:strip=3)$sfx" \ 799 - --sort="refname:strip=3" \ 800 - ${GIT_COMPLETION_IGNORE_CASE+--ignore-case} \ 801 - "refs/remotes/*/$cur_*" "refs/remotes/*/$cur_*/**" | \ 802 - uniq -u 797 + local awk_script=' 798 + function casemap(s) { 799 + if (ENVIRON["IGNORE_CASE"]) 800 + return tolower(s) 801 + else 802 + return s 803 + } 804 + BEGIN { 805 + split(ENVIRON["REMOTES"], remotes, /\n/) 806 + for (i in remotes) 807 + remotes[i] = "refs/remotes/" casemap(remotes[i]) 808 + cur_ = casemap(ENVIRON["CUR_"]) 809 + } 810 + { 811 + ref_case = casemap($0) 812 + for (i in remotes) { 813 + if (index(ref_case, remotes[i] "/" cur_) == 1) { 814 + branch = substr($0, length(remotes[i] "/") + 1) 815 + print ENVIRON["PFX"] branch ENVIRON["SFX"] 816 + break 817 + } 818 + } 819 + } 820 + ' 821 + __git for-each-ref --format='%(refname)' refs/remotes/ | 822 + PFX="$pfx" SFX="$sfx" CUR_="$cur_" \ 823 + IGNORE_CASE=${GIT_COMPLETION_IGNORE_CASE+1} \ 824 + REMOTES="$(__git_remotes | sort -r)" awk "$awk_script" | 825 + sort | uniq -u 803 826 } 804 827 805 828 # Lists refs from the local (by default) or from a remote repository. ··· 905 928 case "HEAD" in 906 929 $match*|$umatch*) echo "${pfx}HEAD$sfx" ;; 907 930 esac 908 - __git for-each-ref --format="$fer_pfx%(refname:strip=3)$sfx" \ 931 + local strip="$(__git_count_path_components "refs/remotes/$remote")" 932 + __git for-each-ref --format="$fer_pfx%(refname:strip=$strip)$sfx" \ 909 933 ${GIT_COMPLETION_IGNORE_CASE+--ignore-case} \ 910 934 "refs/remotes/$remote/$match*" \ 911 935 "refs/remotes/$remote/$match*/**"
+158 -22
t/t9902-completion.sh
··· 149 149 test_expect_success 'setup for __git_find_repo_path/__gitdir tests' ' 150 150 mkdir -p subdir/subsubdir && 151 151 mkdir -p non-repo && 152 - git init -b main otherrepo 152 + git init -b main otherrepo && 153 + git init -b main slashrepo 153 154 ' 154 155 155 156 test_expect_success '__git_find_repo_path - from command line (through $__git_dir)' ' ··· 674 675 ) && 675 676 git remote add other "$ROOT/otherrepo/.git" && 676 677 git fetch --no-tags other && 678 + ( 679 + cd slashrepo && 680 + git commit --allow-empty -m initial && 681 + git branch -m main branch/with/slash 682 + ) && 683 + git remote add remote/with/slash "$ROOT/slashrepo/.git" && 684 + git fetch --no-tags remote/with/slash && 677 685 rm -f .git/FETCH_HEAD && 678 686 git init thirdrepo 679 687 ' ··· 686 694 other/HEAD 687 695 other/branch-in-other 688 696 other/main-in-other 697 + remote/with/slash/HEAD 698 + remote/with/slash/branch/with/slash 689 699 matching-tag 690 700 EOF 691 701 ( ··· 702 712 refs/remotes/other/HEAD 703 713 refs/remotes/other/branch-in-other 704 714 refs/remotes/other/main-in-other 715 + refs/remotes/remote/with/slash/HEAD 716 + refs/remotes/remote/with/slash/branch/with/slash 705 717 refs/tags/matching-tag 706 718 EOF 707 719 ( ··· 767 779 test_cmp expected "$actual" 768 780 ' 769 781 782 + test_expect_success '__git_refs - configured remote - with slash' ' 783 + cat >expected <<-EOF && 784 + HEAD 785 + HEAD 786 + branch/with/slash 787 + EOF 788 + ( 789 + cur= && 790 + __git_refs remote/with/slash >"$actual" 791 + ) && 792 + test_cmp expected "$actual" 793 + ' 794 + 770 795 test_expect_success '__git_refs - configured remote - full refs' ' 771 796 cat >expected <<-EOF && 772 797 HEAD ··· 909 934 other/ambiguous 910 935 other/branch-in-other 911 936 other/main-in-other 912 - remote/ambiguous 913 - remote/branch-in-remote 937 + remote/with/slash/HEAD 938 + remote/with/slash/ambiguous 939 + remote/with/slash/branch-in-remote 940 + remote/with/slash/branch/with/slash 914 941 matching-tag 915 - HEAD 916 942 branch-in-other 917 943 branch-in-remote 944 + branch/with/slash 918 945 main-in-other 919 946 EOF 920 947 for remote_ref in refs/remotes/other/ambiguous \ 921 - refs/remotes/remote/ambiguous \ 922 - refs/remotes/remote/branch-in-remote 948 + refs/remotes/remote/with/slash/ambiguous \ 949 + refs/remotes/remote/with/slash/branch-in-remote 923 950 do 924 951 git update-ref $remote_ref main && 925 952 test_when_finished "git update-ref -d $remote_ref" || return 1 ··· 939 966 other/HEAD 940 967 other/branch-in-other 941 968 other/main-in-other 969 + remote/with/slash/HEAD 970 + remote/with/slash/branch/with/slash 942 971 matching-tag 943 972 EOF 944 973 ( ··· 955 984 refs/remotes/other/HEAD 956 985 refs/remotes/other/branch-in-other 957 986 refs/remotes/other/main-in-other 987 + refs/remotes/remote/with/slash/HEAD 988 + refs/remotes/remote/with/slash/branch/with/slash 958 989 refs/tags/matching-tag 959 990 EOF 960 991 ( ··· 972 1003 ^other/HEAD 973 1004 ^other/branch-in-other 974 1005 ^other/main-in-other 1006 + ^remote/with/slash/HEAD 1007 + ^remote/with/slash/branch/with/slash 975 1008 ^matching-tag 976 1009 EOF 977 1010 ( ··· 988 1021 ^refs/remotes/other/HEAD 989 1022 ^refs/remotes/other/branch-in-other 990 1023 ^refs/remotes/other/main-in-other 1024 + ^refs/remotes/remote/with/slash/HEAD 1025 + ^refs/remotes/remote/with/slash/branch/with/slash 991 1026 ^refs/tags/matching-tag 992 1027 EOF 993 1028 ( ··· 1015 1050 other/branch-in-other 1016 1051 other/main-in-other 1017 1052 other/matching/branch-in-other 1053 + remote/with/slash/HEAD 1054 + remote/with/slash/branch/with/slash 1018 1055 matching-tag 1019 1056 matching/tag 1020 1057 EOF ··· 1135 1172 other/HEAD Z 1136 1173 other/branch-in-other Z 1137 1174 other/main-in-other Z 1175 + remote/with/slash/HEAD Z 1176 + remote/with/slash/branch/with/slash Z 1138 1177 matching-tag Z 1139 1178 EOF 1140 1179 ( ··· 1173 1212 test_cmp expected out 1174 1213 ' 1175 1214 1215 + test_expect_success '__git_complete_refs - remote - with slash' ' 1216 + sed -e "s/Z$//" >expected <<-EOF && 1217 + HEAD Z 1218 + HEAD Z 1219 + branch/with/slash Z 1220 + EOF 1221 + ( 1222 + cur= && 1223 + __git_complete_refs --remote=remote/with/slash && 1224 + print_comp 1225 + ) && 1226 + test_cmp expected out 1227 + ' 1228 + 1176 1229 test_expect_success '__git_complete_refs - track' ' 1177 1230 sed -e "s/Z$//" >expected <<-EOF && 1178 1231 HEAD Z ··· 1181 1234 other/HEAD Z 1182 1235 other/branch-in-other Z 1183 1236 other/main-in-other Z 1237 + remote/with/slash/HEAD Z 1238 + remote/with/slash/branch/with/slash Z 1184 1239 matching-tag Z 1185 - HEAD Z 1186 1240 branch-in-other Z 1241 + branch/with/slash Z 1187 1242 main-in-other Z 1188 1243 EOF 1189 1244 ( ··· 1228 1283 other/HEAD. 1229 1284 other/branch-in-other. 1230 1285 other/main-in-other. 1286 + remote/with/slash/HEAD. 1287 + remote/with/slash/branch/with/slash. 1231 1288 matching-tag. 1232 1289 EOF 1233 1290 ( ··· 1253 1310 test_cmp expected out 1254 1311 ' 1255 1312 1313 + test_expect_success '__git_complete_fetch_refspecs - with slash' ' 1314 + sed -e "s/Z$//" >expected <<-EOF && 1315 + HEAD:HEAD Z 1316 + HEAD:HEAD Z 1317 + branch/with/slash:branch/with/slash Z 1318 + EOF 1319 + ( 1320 + cur= && 1321 + __git_complete_fetch_refspecs remote/with/slash && 1322 + print_comp 1323 + ) && 1324 + test_cmp expected out 1325 + ' 1326 + 1256 1327 test_expect_success '__git_complete_fetch_refspecs - matching' ' 1257 1328 sed -e "s/Z$//" >expected <<-EOF && 1258 1329 branch-in-other:branch-in-other Z ··· 1333 1404 1334 1405 test_expect_success 'git switch - with no options, complete local branches and unique remote branch names for DWIM logic' ' 1335 1406 test_completion "git switch " <<-\EOF 1336 - HEAD Z 1337 1407 branch-in-other Z 1408 + branch/with/slash Z 1338 1409 main Z 1339 1410 main-in-other Z 1340 1411 matching-branch Z ··· 1480 1551 test_expect_success 'git checkout - completes refs and unique remote branches for DWIM' ' 1481 1552 test_completion "git checkout " <<-\EOF 1482 1553 HEAD Z 1483 - HEAD Z 1484 1554 branch-in-other Z 1555 + branch/with/slash Z 1485 1556 main Z 1486 1557 main-in-other Z 1487 1558 matching-branch Z ··· 1489 1560 other/HEAD Z 1490 1561 other/branch-in-other Z 1491 1562 other/main-in-other Z 1563 + remote/with/slash/HEAD Z 1564 + remote/with/slash/branch/with/slash Z 1492 1565 EOF 1493 1566 ' 1494 1567 ··· 1508 1581 1509 1582 test_expect_success 'git switch - --guess overrides GIT_COMPLETION_CHECKOUT_NO_GUESS=1, complete local branches and unique remote names for DWIM logic' ' 1510 1583 GIT_COMPLETION_CHECKOUT_NO_GUESS=1 test_completion "git switch --guess " <<-\EOF 1511 - HEAD Z 1512 1584 branch-in-other Z 1585 + branch/with/slash Z 1513 1586 main Z 1514 1587 main-in-other Z 1515 1588 matching-branch Z ··· 1518 1591 1519 1592 test_expect_success 'git switch - a later --guess overrides previous --no-guess, complete local and remote unique branches for DWIM' ' 1520 1593 test_completion "git switch --no-guess --guess " <<-\EOF 1521 - HEAD Z 1522 1594 branch-in-other Z 1595 + branch/with/slash Z 1523 1596 main Z 1524 1597 main-in-other Z 1525 1598 matching-branch Z ··· 1542 1615 other/HEAD Z 1543 1616 other/branch-in-other Z 1544 1617 other/main-in-other Z 1618 + remote/with/slash/HEAD Z 1619 + remote/with/slash/branch/with/slash Z 1545 1620 EOF 1546 1621 ' 1547 1622 1548 1623 test_expect_success 'git checkout - --guess overrides GIT_COMPLETION_NO_GUESS=1, complete refs and unique remote branches for DWIM' ' 1549 1624 GIT_COMPLETION_CHECKOUT_NO_GUESS=1 test_completion "git checkout --guess " <<-\EOF 1550 1625 HEAD Z 1551 - HEAD Z 1552 1626 branch-in-other Z 1627 + branch/with/slash Z 1553 1628 main Z 1554 1629 main-in-other Z 1555 1630 matching-branch Z ··· 1557 1632 other/HEAD Z 1558 1633 other/branch-in-other Z 1559 1634 other/main-in-other Z 1635 + remote/with/slash/HEAD Z 1636 + remote/with/slash/branch/with/slash Z 1560 1637 EOF 1561 1638 ' 1562 1639 ··· 1569 1646 other/HEAD Z 1570 1647 other/branch-in-other Z 1571 1648 other/main-in-other Z 1649 + remote/with/slash/HEAD Z 1650 + remote/with/slash/branch/with/slash Z 1572 1651 EOF 1573 1652 ' 1574 1653 1575 1654 test_expect_success 'git checkout - a later --guess overrides previous --no-guess, complete refs and unique remote branches for DWIM' ' 1576 1655 test_completion "git checkout --no-guess --guess " <<-\EOF 1577 1656 HEAD Z 1578 - HEAD Z 1579 1657 branch-in-other Z 1658 + branch/with/slash Z 1580 1659 main Z 1581 1660 main-in-other Z 1582 1661 matching-branch Z ··· 1584 1663 other/HEAD Z 1585 1664 other/branch-in-other Z 1586 1665 other/main-in-other Z 1666 + remote/with/slash/HEAD Z 1667 + remote/with/slash/branch/with/slash Z 1587 1668 EOF 1588 1669 ' 1589 1670 ··· 1596 1677 other/HEAD Z 1597 1678 other/branch-in-other Z 1598 1679 other/main-in-other Z 1680 + remote/with/slash/HEAD Z 1681 + remote/with/slash/branch/with/slash Z 1599 1682 EOF 1600 1683 ' 1601 1684 ··· 1609 1692 other/HEAD Z 1610 1693 other/branch-in-other Z 1611 1694 other/main-in-other Z 1695 + remote/with/slash/HEAD Z 1696 + remote/with/slash/branch/with/slash Z 1612 1697 EOF 1613 1698 ' 1614 1699 ··· 1616 1701 test_config checkout.guess true && 1617 1702 test_completion "git checkout " <<-\EOF 1618 1703 HEAD Z 1619 - HEAD Z 1620 1704 branch-in-other Z 1705 + branch/with/slash Z 1621 1706 main Z 1622 1707 main-in-other Z 1623 1708 matching-branch Z ··· 1625 1710 other/HEAD Z 1626 1711 other/branch-in-other Z 1627 1712 other/main-in-other Z 1713 + remote/with/slash/HEAD Z 1714 + remote/with/slash/branch/with/slash Z 1628 1715 EOF 1629 1716 ' 1630 1717 1631 1718 test_expect_success 'git checkout - a later --guess overrides previous checkout.guess = false, complete refs and unique remote branches for DWIM' ' 1632 1719 test_config checkout.guess false && 1633 1720 test_completion "git checkout --guess " <<-\EOF 1634 - HEAD Z 1635 1721 HEAD Z 1636 1722 branch-in-other Z 1723 + branch/with/slash Z 1637 1724 main Z 1638 1725 main-in-other Z 1639 1726 matching-branch Z ··· 1641 1728 other/HEAD Z 1642 1729 other/branch-in-other Z 1643 1730 other/main-in-other Z 1731 + remote/with/slash/HEAD Z 1732 + remote/with/slash/branch/with/slash Z 1644 1733 EOF 1645 1734 ' 1646 1735 ··· 1654 1743 other/HEAD Z 1655 1744 other/branch-in-other Z 1656 1745 other/main-in-other Z 1746 + remote/with/slash/HEAD Z 1747 + remote/with/slash/branch/with/slash Z 1657 1748 EOF 1658 1749 ' 1659 1750 ··· 1666 1757 other/HEAD Z 1667 1758 other/branch-in-other Z 1668 1759 other/main-in-other Z 1760 + remote/with/slash/HEAD Z 1761 + remote/with/slash/branch/with/slash Z 1669 1762 EOF 1670 1763 ' 1671 1764 ··· 1678 1771 other/HEAD Z 1679 1772 other/branch-in-other Z 1680 1773 other/main-in-other Z 1774 + remote/with/slash/HEAD Z 1775 + remote/with/slash/branch/with/slash Z 1681 1776 EOF 1682 1777 ' 1683 1778 ··· 1850 1945 other/HEAD Z 1851 1946 other/branch-in-other Z 1852 1947 other/main-in-other Z 1948 + remote/with/slash/HEAD Z 1949 + remote/with/slash/branch/with/slash Z 1853 1950 EOF 1854 1951 ' 1855 1952 ··· 1862 1959 other/HEAD Z 1863 1960 other/branch-in-other Z 1864 1961 other/main-in-other Z 1962 + remote/with/slash/HEAD Z 1963 + remote/with/slash/branch/with/slash Z 1865 1964 EOF 1866 1965 ' 1867 1966 ··· 1870 1969 other/HEAD Z 1871 1970 other/branch-in-other Z 1872 1971 other/main-in-other Z 1972 + remote/with/slash/HEAD Z 1973 + remote/with/slash/branch/with/slash Z 1873 1974 EOF 1874 1975 test_completion "git switch -t " <<-\EOF 1875 1976 other/HEAD Z 1876 1977 other/branch-in-other Z 1877 1978 other/main-in-other Z 1979 + remote/with/slash/HEAD Z 1980 + remote/with/slash/branch/with/slash Z 1878 1981 EOF 1879 1982 ' 1880 1983 ··· 1883 1986 other/HEAD Z 1884 1987 other/branch-in-other Z 1885 1988 other/main-in-other Z 1989 + remote/with/slash/HEAD Z 1990 + remote/with/slash/branch/with/slash Z 1886 1991 EOF 1887 1992 test_completion "git checkout -t " <<-\EOF 1888 1993 other/HEAD Z 1889 1994 other/branch-in-other Z 1890 1995 other/main-in-other Z 1996 + remote/with/slash/HEAD Z 1997 + remote/with/slash/branch/with/slash Z 1891 1998 EOF 1892 1999 ' 1893 2000 ··· 1907 2014 other/HEAD Z 1908 2015 other/branch-in-other Z 1909 2016 other/main-in-other Z 2017 + remote/with/slash/HEAD Z 2018 + remote/with/slash/branch/with/slash Z 1910 2019 EOF 1911 2020 ' 1912 2021 ··· 1919 2028 other/HEAD Z 1920 2029 other/branch-in-other Z 1921 2030 other/main-in-other Z 2031 + remote/with/slash/HEAD Z 2032 + remote/with/slash/branch/with/slash Z 1922 2033 EOF 1923 2034 ' 1924 2035 ··· 1931 2042 other/HEAD Z 1932 2043 other/branch-in-other Z 1933 2044 other/main-in-other Z 2045 + remote/with/slash/HEAD Z 2046 + remote/with/slash/branch/with/slash Z 1934 2047 EOF 1935 2048 ' 1936 2049 ··· 1943 2056 other/HEAD Z 1944 2057 other/branch-in-other Z 1945 2058 other/main-in-other Z 2059 + remote/with/slash/HEAD Z 2060 + remote/with/slash/branch/with/slash Z 1946 2061 EOF 1947 2062 ' 1948 2063 ··· 1955 2070 other/HEAD Z 1956 2071 other/branch-in-other Z 1957 2072 other/main-in-other Z 2073 + remote/with/slash/HEAD Z 2074 + remote/with/slash/branch/with/slash Z 1958 2075 EOF 1959 2076 ' 1960 2077 ··· 1967 2084 other/HEAD Z 1968 2085 other/branch-in-other Z 1969 2086 other/main-in-other Z 2087 + remote/with/slash/HEAD Z 2088 + remote/with/slash/branch/with/slash Z 1970 2089 EOF 1971 2090 ' 1972 2091 ··· 1979 2098 other/HEAD Z 1980 2099 other/branch-in-other Z 1981 2100 other/main-in-other Z 2101 + remote/with/slash/HEAD Z 2102 + remote/with/slash/branch/with/slash Z 1982 2103 EOF 1983 2104 ' 1984 2105 ··· 1991 2112 other/HEAD Z 1992 2113 other/branch-in-other Z 1993 2114 other/main-in-other Z 2115 + remote/with/slash/HEAD Z 2116 + remote/with/slash/branch/with/slash Z 1994 2117 EOF 1995 2118 ' 1996 2119 ··· 2003 2126 other/HEAD Z 2004 2127 other/branch-in-other Z 2005 2128 other/main-in-other Z 2129 + remote/with/slash/HEAD Z 2130 + remote/with/slash/branch/with/slash Z 2006 2131 EOF 2007 2132 ' 2008 2133 ··· 2015 2140 other/HEAD Z 2016 2141 other/branch-in-other Z 2017 2142 other/main-in-other Z 2143 + remote/with/slash/HEAD Z 2144 + remote/with/slash/branch/with/slash Z 2018 2145 EOF 2019 2146 ' 2020 2147 ··· 2027 2154 other/HEAD Z 2028 2155 other/branch-in-other Z 2029 2156 other/main-in-other Z 2157 + remote/with/slash/HEAD Z 2158 + remote/with/slash/branch/with/slash Z 2030 2159 EOF 2031 2160 ' 2032 2161 ··· 2039 2168 other/HEAD Z 2040 2169 other/branch-in-other Z 2041 2170 other/main-in-other Z 2171 + remote/with/slash/HEAD Z 2172 + remote/with/slash/branch/with/slash Z 2042 2173 EOF 2043 2174 ' 2044 2175 ··· 2051 2182 other/HEAD Z 2052 2183 other/branch-in-other Z 2053 2184 other/main-in-other Z 2185 + remote/with/slash/HEAD Z 2186 + remote/with/slash/branch/with/slash Z 2054 2187 EOF 2055 2188 ' 2056 2189 2057 2190 test_expect_success 'git switch - for -c, complete local branches and unique remote branches' ' 2058 2191 test_completion "git switch -c " <<-\EOF 2059 - HEAD Z 2060 2192 branch-in-other Z 2193 + branch/with/slash Z 2061 2194 main Z 2062 2195 main-in-other Z 2063 2196 matching-branch Z ··· 2066 2199 2067 2200 test_expect_success 'git switch - for -C, complete local branches and unique remote branches' ' 2068 2201 test_completion "git switch -C " <<-\EOF 2069 - HEAD Z 2070 2202 branch-in-other Z 2203 + branch/with/slash Z 2071 2204 main Z 2072 2205 main-in-other Z 2073 2206 matching-branch Z ··· 2104 2237 2105 2238 test_expect_success 'git checkout - for -b, complete local branches and unique remote branches' ' 2106 2239 test_completion "git checkout -b " <<-\EOF 2107 - HEAD Z 2108 2240 branch-in-other Z 2241 + branch/with/slash Z 2109 2242 main Z 2110 2243 main-in-other Z 2111 2244 matching-branch Z ··· 2114 2247 2115 2248 test_expect_success 'git checkout - for -B, complete local branches and unique remote branches' ' 2116 2249 test_completion "git checkout -B " <<-\EOF 2117 - HEAD Z 2118 2250 branch-in-other Z 2251 + branch/with/slash Z 2119 2252 main Z 2120 2253 main-in-other Z 2121 2254 matching-branch Z ··· 2152 2285 2153 2286 test_expect_success 'git switch - with --orphan completes local branch names and unique remote branch names' ' 2154 2287 test_completion "git switch --orphan " <<-\EOF 2155 - HEAD Z 2156 2288 branch-in-other Z 2289 + branch/with/slash Z 2157 2290 main Z 2158 2291 main-in-other Z 2159 2292 matching-branch Z ··· 2168 2301 2169 2302 test_expect_success 'git checkout - with --orphan completes local branch names and unique remote branch names' ' 2170 2303 test_completion "git checkout --orphan " <<-\EOF 2171 - HEAD Z 2172 2304 branch-in-other Z 2305 + branch/with/slash Z 2173 2306 main Z 2174 2307 main-in-other Z 2175 2308 matching-branch Z ··· 2185 2318 other/HEAD Z 2186 2319 other/branch-in-other Z 2187 2320 other/main-in-other Z 2321 + remote/with/slash/HEAD Z 2322 + remote/with/slash/branch/with/slash Z 2188 2323 EOF 2189 2324 ' 2190 2325 ··· 2199 2334 test_expect_success 'teardown after ref completion' ' 2200 2335 git branch -d matching-branch && 2201 2336 git tag -d matching-tag && 2202 - git remote remove other 2337 + git remote remove other && 2338 + git remote remove remote/with/slash 2203 2339 ' 2204 2340 2205 2341