summaryrefslogtreecommitdiff
path: root/rebase.c
diff options
context:
space:
mode:
authorJacob Keller <jacob.keller@gmail.com>2020-05-28 18:10:47 (GMT)
committerJunio C Hamano <gitster@pobox.com>2020-05-28 19:57:07 (GMT)
commitacb658fe7d6bc11136be0756270fda675af74761 (patch)
treee8e5cd9c27796e74b5c83b60d24d6d4ff63021dd /rebase.c
parent00e7bd2b0057a20d78193405af73b0acebdd86d2 (diff)
downloadgit-acb658fe7d6bc11136be0756270fda675af74761.zip
git-acb658fe7d6bc11136be0756270fda675af74761.tar.gz
git-acb658fe7d6bc11136be0756270fda675af74761.tar.bz2
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 'rebase.c')
0 files changed, 0 insertions, 0 deletions