Skip to content

Commit d031049

Browse files
matheustavaresgitster
authored andcommitted
completion: add support for sparse-checkout
Signed-off-by: Matheus Tavares <[email protected]> Acked-by: Derrick Stolee <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent a402723 commit d031049

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

contrib/completion/git-completion.bash

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2718,6 +2718,27 @@ _git_show_branch ()
27182718
__git_complete_revlist
27192719
}
27202720

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+
27212742
_git_stash ()
27222743
{
27232744
local save_opts='--all --keep-index --no-keep-index --quiet --patch --include-untracked'

0 commit comments

Comments
 (0)