Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenton Liu <liu.denton@gmail.com>2021-04-22 13:00:52 +0300
committerJunio C Hamano <gitster@pobox.com>2021-04-27 09:41:07 +0300
commit7cdb0969037418b6f09b0a434e51cbf66090c624 (patch)
tree14d3dbd7bae428bb21e2d0cb25b37c5ff660e709 /contrib/completion/git-completion.bash
parent59d85a2a0528c3db2552b0786caac7bf0610c552 (diff)
git-completion.bash: consolidate cases in _git_stash()
The $subcommand case statement in _git_stash() is quite repetitive. Consolidate the cases together into one catch-all case to reduce the repetition. Signed-off-by: Denton Liu <liu.denton@gmail.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, 2 insertions, 19 deletions
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 30c9a97616..7bce9a0112 100644
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -3032,21 +3032,6 @@ _git_stash ()
fi
case "$subcommand,$cur" in
- push,--*)
- __gitcomp_builtin stash_push
- ;;
- save,--*)
- __gitcomp_builtin stash_save
- ;;
- pop,--*)
- __gitcomp_builtin stash_pop
- ;;
- apply,--*)
- __gitcomp_builtin stash_apply
- ;;
- drop,--*)
- __gitcomp_builtin stash_drop
- ;;
list,--*)
# NEEDSWORK: can we somehow unify this with the options in _git_log() and _git_show()
__gitcomp_builtin stash_list "$__git_log_common_options $__git_diff_common_options"
@@ -3054,8 +3039,8 @@ _git_stash ()
show,--*)
__gitcomp_builtin stash_show "$__git_diff_common_options"
;;
- branch,--*)
- __gitcomp_builtin stash_branch
+ *,--*)
+ __gitcomp_builtin "stash_$subcommand"
;;
branch,*)
if [ $cword -eq $((__git_cmd_idx+2)) ]; then
@@ -3069,8 +3054,6 @@ _git_stash ()
__gitcomp_nl "$(__git stash list \
| sed -n -e 's/:.*//p')"
;;
- *)
- ;;
esac
}