]> git.ipfire.org Git - thirdparty/git.git/commitdiff
completion: teach ls-remote to complete options
authorCornelius Weig <cornelius.weig@tngtech.com>
Fri, 3 Feb 2017 11:01:56 +0000 (12:01 +0100)
committerJunio C Hamano <gitster@pobox.com>
Sat, 4 Feb 2017 06:25:46 +0000 (22:25 -0800)
ls-remote needs to complete remote names and its own options. In
addition to the existing remote name completions, do also complete
the options --heads, --tags, --refs, --get-url, and --symref.

Signed-off-by: Cornelius Weig <cornelius.weig@tngtech.com>
Reviewed-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
contrib/completion/git-completion.bash

index bfa3afb4c130d05744b94e9993422b2941b06d07..2ed0ef629788a9ad559dbbb0b32537365aa63d44 100644 (file)
@@ -1449,6 +1449,12 @@ _git_ls_files ()
 
 _git_ls_remote ()
 {
+       case "$cur" in
+       --*)
+               __gitcomp "--heads --tags --refs --get-url --symref"
+               return
+               ;;
+       esac
        __gitcomp_nl "$(__git_remotes)"
 }