@matheusbsbs / matheus-bagliano / commits / d031049da3
Fork 0

completion: add support for sparse-checkout

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>

Matheus Tavares committed Jan 23, 2020 at 16:00 UTC d031049da356fc345d75c51ec1fbfbeab0f1c8cb
1 file changed +21
contrib/completion/git-completion.bash
+21
@@ -2718,6 +2718,27 @@ _git_show_branch ()
2718 __git_complete_revlist
2719 }
2720
2721 +_git_sparse_checkout ()
2722 +{
2723 + local subcommands="list init set disable"
2724 + local subcommand="$(__git_find_on_cmdline "$subcommands")"
2725 + if [ -z "$subcommand" ]; then
2726 + __gitcomp "$subcommands"
2727 + return
2728 + fi
2729 +
2730 + case "$subcommand,$cur" in
2731 + init,--*)
2732 + __gitcomp "--cone"
2733 + ;;
2734 + set,--*)
2735 + __gitcomp "--stdin"
2736 + ;;
2737 + *)
2738 + ;;
2739 + esac
2740 +}
2741 +
2742 _git_stash ()
2743 {
2744 local save_opts='--all --keep-index --no-keep-index --quiet --patch --include-untracked'