summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog3
-rw-r--r--Completion/Unix/Command/_git4
2 files changed, 7 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 4cdb1eae3..e0d1ab56e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
2025-09-24 Oliver Kiddle <opk@zsh.org>
+ * Markus Kurtz: github #143: Completion/Unix/Command/_git:
+ list only remote branches for `git checkout --guess`
+
* Elliot Berman: github #142: Completion/Unix/Command/_git:
fix text for git merge --squash/--no-squash
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 \