completion: fix remote.pushdefault
authorRamkumar Ramachandra <artagnon@gmail.com>
Sun, 5 Jan 2014 10:18:05 +0000 (15:48 +0530)
committerJunio C Hamano <gitster@pobox.com>
Mon, 6 Jan 2014 17:17:25 +0000 (09:17 -0800)
When attempting to complete

$ git config remote.push<TAB>

'pushdefault' doesn't come up. This is because "$cur" is matched with
"remote.*" and a list of remotes are completed. Add 'pushdefault' as a
candidate for completion too, using __gitcomp_nl_append ().

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
contrib/completion/git-completion.bash
index a57bcbe40355f0fe33bc7ea62507d59005a7e5af..4fe5ce31bd99e5c5307761c947d4661241ec3c24 100644 (file)
@@ -1884,6 +1884,7 @@ _git_config ()
        remote.*)
                local pfx="${cur%.*}." cur_="${cur#*.}"
                __gitcomp_nl "$(__git_remotes)" "$pfx" "$cur_" "."
+               __gitcomp_nl_append "pushdefault" "$pfx" "$cur_"
                return
                ;;
        url.*.*)