]> git.ipfire.org Git - thirdparty/git.git/commit
completion(switch/checkout): treat --track and -t the same
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Fri, 8 Sep 2023 12:28:43 +0000 (12:28 +0000)
committerJunio C Hamano <gitster@pobox.com>
Fri, 8 Sep 2023 16:26:15 +0000 (09:26 -0700)
commit9f892830d6965d68bfa937cebcfbed9c9e552700
tree4add82a88d236f64017661c5715936f9b69111e3
parent0d1bd1dfb37ef25e1911777c94129fc769ffec38
completion(switch/checkout): treat --track and -t the same

When `git switch --track ` is to be completed, only remote refs are
eligible because that is what the `--track` option targets.

And when the short-hand `-t` is used instead, the same _should_ happen.
Let's make it so.

Note that the bug exists both in the completions of `switch` and
`completion`, even if it manifests in slightly different ways: While
the completion of `git switch -t ` will not even look at remote refs,
the completion of `git checkout -t ` will look at both remote _and_
local refs. Both should look only at remote refs.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
contrib/completion/git-completion.bash
t/t9902-completion.sh