diff options
author | Jacob Keller <jacob.keller@gmail.com> | 2020-05-28 11:10:47 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-05-28 12:57:07 -0700 |
commit | acb658fe7d6bc11136be0756270fda675af74761 (patch) | |
tree | e8e5cd9c27796e74b5c83b60d24d6d4ff63021dd /t/t3308-notes-merge.sh | |
parent | completion: improve handling of --track in switch/checkout (diff) | |
download | tgif-acb658fe7d6bc11136be0756270fda675af74761.tar.xz |
completion: improve handling of -c/-C and -b/-B in switch/checkout
A previous commit added several test cases highlighting the subpar
completion logic for -c/-C and -b/-B when completing git switch and git
checkout.
In order to distinguish completing the argument vs the start-point for
this option, we now use the wordlist to determine the previous full word
on the command line.
If it's -c or -C (-b/-B for checkout), then we know that we are
completing the argument for the branch name.
Given that a user who already knows the branch name they want to
complete will simply not use completion, it makes sense to complete the
small subset of local branches when completing the argument for -c/-C.
In all other cases, if -c/-C are on the command line but are not the
most recent option, then we must be completing a start-point, and should
allow completing against all references.
Update the -c/-C and -b/-B tests to indicate they now pass.
Signed-off-by: Jacob Keller <jacob.keller@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t3308-notes-merge.sh')
0 files changed, 0 insertions, 0 deletions