d4d8939410edf3b81e6cd6a63b39744262691185

Author
JamesFerguson <jim@The-Ocean.local>
Committer
JamesFerguson <jim@The-Ocean.local>
Date

Message

Only trim remote names; be git-flow friendly

 - don't remove everything before the last /
 - do remove <remote_name>/
 - allows flow style feature/foobar branch names

Diff

 1diff --git a/plugins/git-remote-branch/git-remote-branch.plugin.zsh b/plugins/git-remote-branch/git-remote-branch.plugin.zsh
 2index ff98cbf87a296045abbff56082dfeae839f79dbf..6c5ab8f70d38b228bd8d927e1b27b5e186eb6220 100644
 3--- a/plugins/git-remote-branch/git-remote-branch.plugin.zsh
 4+++ b/plugins/git-remote-branch/git-remote-branch.plugin.zsh
 5@@ -6,7 +6,8 @@ _git_remote_branch() {
 6       compadd create publish rename delete track
 7     elif (( CURRENT == 3 )); then
 8       # second arg: remote branch name
 9-      compadd `git branch -r | grep -v HEAD | sed "s/.*\///" | sed "s/ //g"`
10+      remotes=`git remote | tr '\n' '|' | sed "s/\|$//g"`
11+      compadd `git branch -r | grep -v HEAD | sed "s/$remotes\///" | sed "s/ //g"`
12     elif (( CURRENT == 4 )); then
13       # third arg: remote name
14       compadd `git remote`