]> git.ipfire.org Git - thirdparty/git.git/commit
completion: fix bugs with slashes in remote names
authorDavid Mandelberg <david@mandelberg.org>
Sun, 23 Mar 2025 21:06:53 +0000 (17:06 -0400)
committerJunio C Hamano <gitster@pobox.com>
Mon, 24 Mar 2025 06:03:13 +0000 (23:03 -0700)
commit778d2f1760bf5411ab15657bdaf0ecf19352c502
treebf36c125b19fed936c290b19e2c4b43357ea47f0
parent5637bdc352a7763e30290bb37239a61cb9865d1b
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>
contrib/completion/git-completion.bash
t/t9902-completion.sh