summaryrefslogtreecommitdiff
path: root/12_Prompts.zsh
diff options
context:
space:
mode:
authorHugues Hiegel <hugues.hiegel@qosmos.com>2014-01-24 12:18:46 +0100
committerHugues Hiegel <hugues.hiegel@qosmos.com>2014-01-24 12:21:29 +0100
commit8d49e389d45f8e0554e72fad4230f50dd7497262 (patch)
tree6e460751e250d4c7c89fe644b1ea5a7973d94932 /12_Prompts.zsh
parentf9553215ad2a35127aef32dab0655966ddf41be5 (diff)
[Submodules] uses pretty-names
Diffstat (limited to '12_Prompts.zsh')
-rw-r--r--12_Prompts.zsh7
1 files changed, 5 insertions, 2 deletions
diff --git a/12_Prompts.zsh b/12_Prompts.zsh
index f3139af..d49b947 100644
--- a/12_Prompts.zsh
+++ b/12_Prompts.zsh
@@ -229,10 +229,13 @@ __subvcsbranches () {
# Get recursive submodules statuses
for SUBMODULE in $(git config --get zsh.recurse-dirs)
do
- if [ -d $(dirname $GIT_DIR)/$SUBMODULE/.git -o -d $GIT_DIR/modules/$SUBMODULE ]
+ _sub=$(dirname $GIT_DIR)/$SUBMODULE/.git
+ [ ! -d $_sub ] && _sub=$(dirname $GIT_DIR)/modules/$SUBMODULE
+ if [ -d $_sub ]
then
GITBRANCH+=${GITBRANCH:+$(tput cuf1)}
- GITBRANCH+=$C_$_prompt_colors[bar]$_C"[%{%B%}$SUBMODULE%{%b%}:"
+ _name=$(GIT_DIR=$_sub git config --get zsh.pretty-name )
+ GITBRANCH+=$C_$_prompt_colors[bar]$_C"[%{%B%}"${_name:-$SUBMODULE}"%{%b%}:"
GITBRANCH+=$(__get_git_fullstatus $(dirname $GIT_DIR)/$SUBMODULE)
GITBRANCH+=$C_$_prompt_colors[bar]$_C"]"
fi