diff options
| author | Junio C Hamano <gitster@pobox.com> | 2026-08-13 12:12:33 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2026-08-13 12:13:56 -0700 |
| commit | 3fe92099860aabc8af341334562ff7cdb5e3a9a3 (patch) | |
| tree | acc188f2aaf9a97531a30204184045b06990408c /contrib/persistent-https | |
| parent | 735514635b49332efba080ed8e2c75b5e3c37a6e (diff) | |
completion: complete tracked paths for "git checkout"
When completing arguments for "git checkout", _git_checkout()
delegates to __git_complete_refs(), which only completes revision
references. This is good, as mixing revisions and paths in a single
list from which the user can choose is confusing. However, if no
reference matches, or if "--" is given, _git_checkout() leaves
COMPREPLY empty. Bash then falls back to the default filename
completion in $PWD.
This fails when "git -C <path>" is used, as $PWD is not the target
repository.
Update _git_checkout() to use __git_complete_index_file() when "--"
is present, or when revision reference completion yields no matching
candidates, so that tracked paths are offered as candidates.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'contrib/persistent-https')
0 files changed, 0 insertions, 0 deletions
