summaryrefslogtreecommitdiff
path: root/compat/obstack.h
diff options
context:
space:
mode:
authorLibravatar SZEDER Gábor <szeder.dev@gmail.com>2017-03-23 16:29:13 +0100
committerLibravatar Junio C Hamano <gitster@pobox.com>2017-03-23 11:18:22 -0700
commit2ea328a119709a2a94b16cea28ef0e5d7405c5f9 (patch)
treeb63cca31e9c2e9a9aaf5f85f2b1a231077133792 /compat/obstack.h
parentcompletion: wrap __git_refs() for better option parsing (diff)
downloadtgif-2ea328a119709a2a94b16cea28ef0e5d7405c5f9.tar.xz
completion: support completing full refs after '--option=refs/<TAB>'
Completing full refs currently only works when the full ref stands on in its own on the command line, but doesn't work when the current word to be completed contains a prefix before the full ref, e.g. '--option=refs/<TAB>' or 'master..refs/bis<TAB>'. The reason is that __git_refs() looks at the current word to be completed ($cur) as a whole to decide whether it has to list full (if it starts with 'refs/') or short refs (otherwise). However, $cur also holds said '--option=' or 'master..' prefixes, which of course throw off this decision. Luckily, the default action is to list short refs, that's why completing short refs happens to work even after a 'master..<TAB>' prefix and similar cases. Pass only the ref part of the current word to be completed to __git_refs() as a new positional parameter, so it can make the right decision even if the whole current word contains some kind of a prefix. Make this new parameter the 4. positional parameter and leave the 3. as an ignored placeholder for now (it will be used later in this patch series). Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'compat/obstack.h')
0 files changed, 0 insertions, 0 deletions