about summary refs log tree commit diff
diff options
context:
space:
mode:
authorDaniel Shahaf <d.s@daniel.shahaf.name>2016-07-28 12:37:14 +0000
committerDaniel Shahaf <d.s@daniel.shahaf.name>2017-02-07 08:43:31 +0000
commit3afd12ae9716b25ef03c768b270ea91e9202364f (patch)
tree568f63045fb3d2074cb4e527cd32123ea87d2b6b
parent4da5c23dcecde6975869dd7b08e5f9176748d12c (diff)
downloadzsh-3afd12ae9716b25ef03c768b270ea91e9202364f.tar.gz
zsh-3afd12ae9716b25ef03c768b270ea91e9202364f.tar.xz
zsh-3afd12ae9716b25ef03c768b270ea91e9202364f.zip
40493/0002: _git-checkout: Reorder default completions.
The unprefixed name of a remote branch is used to create a new local
remote-tracking branch; that is presumed to be a rarer operation than
either switching among local branches or reverting to the index version
of a modified file.

Between the remaining two, put modified files before tree-ishes because
there are generally few of the former and many of the latter.
-rw-r--r--ChangeLog5
-rw-r--r--Completion/Unix/Command/_git5
2 files changed, 8 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 94df516ba..83a27f454 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2017-02-07  Daniel Shahaf  <d.s@daniel.shahaf.name>
 
+	* 40493/0002: Completion/Unix/Command/_git: _git-checkout:
+	Reorder default completions.
+
+2017-02-07  Daniel Shahaf  <d.s@daniel.shahaf.name>
+
 	* 40493/0001: Completion/Unix/Command/_git: _git-checkout:
 	No functional change.
 
diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git
index 8b78b5785..b16d2bc4c 100644
--- a/Completion/Unix/Command/_git
+++ b/Completion/Unix/Command/_git
@@ -486,9 +486,10 @@ _git-checkout () {
           _alternative $tree_ish_arg $file_arg && ret=0
         else
           _alternative \
-            $remote_branch_noprefix_arg \
+            $file_arg \
             $tree_ish_arg \
-            $file_arg && ret=0
+            $remote_branch_noprefix_arg \
+            && ret=0
         fi
 
       elif [[ -n ${opt_args[(I)-b|-B|-t|--track|--orphan|--detach]} ]]; then