summaryrefslogtreecommitdiff
path: root/contrib/completion
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2018-10-21 08:37:31 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-10-22 03:52:29 (GMT)
commit276b49ff3413434ec491db8fcb56485a71c6b6e7 (patch)
tree00a5f7f202a4c6bfd1b912c4aac73089fde459f0 /contrib/completion
parentb221b5ab9b92f3def37184db6e052ec87d7635b4 (diff)
downloadgit-276b49ff3413434ec491db8fcb56485a71c6b6e7.zip
git-276b49ff3413434ec491db8fcb56485a71c6b6e7.tar.gz
git-276b49ff3413434ec491db8fcb56485a71c6b6e7.tar.bz2
completion: fix __gitcomp_builtin no longer consider extra options
__gitcomp_builtin() has the main completion list provided by git xxx --git-completion-helper but the caller can also add extra options that is not provided by --git-completion-helper. The only call site that does this is "git difftool" completion. This support is broken by b221b5ab9b (completion: collapse extra --no-.. options - 2018-06-06), which adds a special value "--" to mark that the rest of the options can be hidden by default. The commit forgets the fact that extra options are appended after "$(git xxx --git-completion-helper)", i.e. after this "--", and will be incorrectly hidden as well. Prepend the extra options before "$(git xxx --git-completion-helper)" to avoid this. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'contrib/completion')
-rw-r--r--contrib/completion/git-completion.bash2
1 files changed, 1 insertions, 1 deletions
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 425d062..74aae85 100644
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -336,7 +336,7 @@ __gitcomp_builtin ()
if [ -z "$options" ]; then
# leading and trailing spaces are significant to make
# option removal work correctly.
- options=" $(__git ${cmd/_/ } --git-completion-helper) $incl "
+ options=" $incl $(__git ${cmd/_/ } --git-completion-helper) "
for i in $excl; do
options="${options/ $i / }"
done