Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

[PATCH 3/4] _git: fix __git_submodules to only use the actual name of the submodule



The output of 'submodule status' is

Xsha1 name (describe)

X being one of -,+,U,[space]

We are only interested in the name part and not the whole line.

Fix the parameter expansions accordingly.
---
 Completion/Unix/Command/_git | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git
index 8105501..40a86bf 100644
--- a/Completion/Unix/Command/_git
+++ b/Completion/Unix/Command/_git
@@ -5546,7 +5546,7 @@ __git_submodules () {
   local expl
   declare -a submodules
 
-  submodules=(${${(f)"$(_call_program submodules git submodule 2>/dev/null)"}#* })
+  submodules=(${${${(f)"$(_call_program submodules git submodule 2>/dev/null)"}#?* }%% *})
   __git_command_successful $pipestatus || return 1
 
   _wanted submodules expl submodule compadd $* - $submodules
-- 
1.9.0.1.g7244ca4



Messages sorted by: Reverse Date, Date, Thread, Author