]> git.ipfire.org Git - thirdparty/git.git/commitdiff
completion: add support for sparse-checkout
authorMatheus Tavares <matheus.bernardino@usp.br>
Thu, 23 Jan 2020 19:00:03 +0000 (16:00 -0300)
committerJunio C Hamano <gitster@pobox.com>
Thu, 23 Jan 2020 21:20:42 +0000 (13:20 -0800)
Signed-off-by: Matheus Tavares <matheus.bernardino@usp.br>
Acked-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
contrib/completion/git-completion.bash

index e4d9ff4a95ceb56e568131c148de5aaed85219c2..cb1f1b5e20fc569b5d59da7a761a83554c17b20b 100644 (file)
@@ -2718,6 +2718,27 @@ _git_show_branch ()
        __git_complete_revlist
 }
 
+_git_sparse_checkout ()
+{
+       local subcommands="list init set disable"
+       local subcommand="$(__git_find_on_cmdline "$subcommands")"
+       if [ -z "$subcommand" ]; then
+               __gitcomp "$subcommands"
+               return
+       fi
+
+       case "$subcommand,$cur" in
+       init,--*)
+               __gitcomp "--cone"
+               ;;
+       set,--*)
+               __gitcomp "--stdin"
+               ;;
+       *)
+               ;;
+       esac
+}
+
 _git_stash ()
 {
        local save_opts='--all --keep-index --no-keep-index --quiet --patch --include-untracked'