summaryrefslogtreecommitdiff
path: root/contrib/completion/git-completion.bash
diff options
context:
space:
mode:
authorMatheus Tavares <matheus.bernardino@usp.br>2020-01-23 19:00:03 (GMT)
committerJunio C Hamano <gitster@pobox.com>2020-01-23 21:20:42 (GMT)
commitd031049da356fc345d75c51ec1fbfbeab0f1c8cb (patch)
treec1fc2de708e45f277bc74b5b524eee6b3c2f2121 /contrib/completion/git-completion.bash
parenta402723e488c66bd12cf674c332f185fee1d2347 (diff)
downloadgit-d031049da356fc345d75c51ec1fbfbeab0f1c8cb.zip
git-d031049da356fc345d75c51ec1fbfbeab0f1c8cb.tar.gz
git-d031049da356fc345d75c51ec1fbfbeab0f1c8cb.tar.bz2
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>
Diffstat (limited to 'contrib/completion/git-completion.bash')
-rw-r--r--contrib/completion/git-completion.bash21
1 files changed, 21 insertions, 0 deletions
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index e4d9ff4..cb1f1b5 100644
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -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'