summaryrefslogtreecommitdiffstats
path: root/Completion/Unix
diff options
context:
space:
mode:
authorMarkus Kurtz <m@mgkurtz.de>2025-09-02 09:36:30 +0200
committerOliver Kiddle <opk@zsh.org>2025-09-24 00:57:06 +0200
commit8f4002a1e4d8381945b0fa0fec4a1b479acd93b4 (patch)
tree06fecc0eb7b6cf7f111bf6f3bdf07a3e8d253b79 /Completion/Unix
parentgithub #142: Fix text for git merge --squash/--no-squash (diff)
downloadzsh-8f4002a1e4d8381945b0fa0fec4a1b479acd93b4.tar
zsh-8f4002a1e4d8381945b0fa0fec4a1b479acd93b4.tar.gz
zsh-8f4002a1e4d8381945b0fa0fec4a1b479acd93b4.tar.bz2
zsh-8f4002a1e4d8381945b0fa0fec4a1b479acd93b4.tar.lz
zsh-8f4002a1e4d8381945b0fa0fec4a1b479acd93b4.tar.xz
zsh-8f4002a1e4d8381945b0fa0fec4a1b479acd93b4.tar.zst
zsh-8f4002a1e4d8381945b0fa0fec4a1b479acd93b4.zip
github #143: list only remote branches for `git checkout --guess`
Diffstat (limited to 'Completion/Unix')
-rw-r--r--Completion/Unix/Command/_git4
1 files changed, 4 insertions, 0 deletions
diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git
index d6420e77a..fdf35b2f5 100644
--- a/Completion/Unix/Command/_git
+++ b/Completion/Unix/Command/_git
@@ -517,6 +517,10 @@ _git-checkout () {
_alternative remote-branches::__git_remote_branch_names && ret=0
elif [[ -n ${opt_args[(I)--ours|--theirs|-m|--conflict|--patch|--no-guess]} ]]; then
_alternative $tree_ish_arg $file_arg && ret=0
+ elif [[ -n ${opt_args[(i)--guess]} ]]; then
+ # --guess is the default but if it has been explicitly specified,
+ # we'll only complete remote branches
+ __git_remote_branch_names_noprefix && ret=0
else
_alternative \
$file_arg \