b84d336672833d7d2162ee583a1ee5384006f3c7
- Author
- Robby Russell <robby@planetargon.com>
- Committer
- Robby Russell <robby@planetargon.com>
- Date
Message
Merge pull request #985 from pomaxa/master
git plugin function
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