about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPeter Stephenson <p.w.stephenson@ntlworld.com>2014-11-23 21:03:37 +0000
committerPeter Stephenson <p.w.stephenson@ntlworld.com>2014-11-23 21:03:37 +0000
commit9161a16b2e2c770c7d518a394208476cf6c418fd (patch)
treedcc1ad8757cb328ba206005631db098affd28ee0
parentfe65defba227cd49cf9717f98fcac3646d558cee (diff)
downloadzsh-9161a16b2e2c770c7d518a394208476cf6c418fd.tar.gz
zsh-9161a16b2e2c770c7d518a394208476cf6c418fd.tar.xz
zsh-9161a16b2e2c770c7d518a394208476cf6c418fd.zip
33729: "git remote add" should complete local repositories
-rw-r--r--ChangeLog3
-rw-r--r--Completion/Unix/Command/_git10
2 files changed, 12 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index eba113e06..6f8438db2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2014-11-23  Peter Stephenson  <p.w.stephenson@ntlworld.com>
 
+	* 33729: Completion/Unix/Command/_git: "git remote add" should
+	complete local repositories.
+
 	* 33740: Stephane: Doc/Zsh/expn.yo: "hideval" parameter type.
 
 	* 33740: Stephane: Etc/FAQ.yo: Another way of avoiding MULTIO
diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git
index 38bd72979..8fcfc153d 100644
--- a/Completion/Unix/Command/_git
+++ b/Completion/Unix/Command/_git
@@ -3161,7 +3161,15 @@ _git-remote () {
             '(-m --master)'{-m,--master=}'[set HEAD of remote to point to given master branch]: :__git_branch_names' \
             '--mirror[do not use separate remotes]' \
             ':name:__git_remotes' \
-            ':url:_urls' && ret=0
+            ':repository:->repository' && ret=0
+	  case $state in
+	    (repository)
+            _alternative \
+              'local-repositories::__git_local_repositories' \
+              'remote-repositories::__git_remote_repositories' \
+	      'urls::_urls' && ret=0
+	    ;;
+	  esac
           ;;
         (rename)
           _arguments \