b1e4ef17543d4a236ad35417ac36560917e6cadc

Author
pomaxa <pomaxa@ambergames.com>
Committer
pomaxa <pomaxa@ambergames.com>
Date

Message

current repository action

Diff

 1diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh
 2index e1d68250885a7e29e286e30b469fc17e9ae5cc3b..d3d3f702a362c6ebe24109369da2e6d1a8652464 100644
 3--- a/plugins/git/git.plugin.zsh
 4+++ b/plugins/git/git.plugin.zsh
 5@@ -54,10 +54,16 @@ function current_branch() {
 6   echo ${ref#refs/heads/}
 7 }
 8 
 9+function current_repository() {
10+
11+  ref=$(git symbolic-ref HEAD 2> /dev/null) || return
12+  echo $(git remote -v | cut -d':' -f 2)
13+}
14+
15 # these aliases take advantage of the previous function
16 alias ggpull='git pull origin $(current_branch)'
17 compdef ggpull=git
18 alias ggpush='git push origin $(current_branch)'
19 compdef ggpush=git
20 alias ggpnp='git pull origin $(current_branch) && git push origin $(current_branch)'
21-compdef ggpnp=git
22+compdef ggpnp=git