ef70990ce1ac0239005b267e5dcfe096969d26c3

Author
Marc Cornellà <marc.cornella@live.com>
Committer
GitHub <noreply@github.com>
Date

Message

Simplify hub check and hardcode aliasing (#6767)

* Simplify hub check and hardcode aliasing

* Update hub completion

Diff

 1diff --git a/plugins/github/_hub b/plugins/github/_hub
 2index 3a64938784d3b41d65973eb5953ead8896377c5e..1833a9c09d1407d77e9e8d464bc86ed8934298db 100644
 3--- a/plugins/github/_hub
 4+++ b/plugins/github/_hub
 5@@ -89,6 +89,7 @@ __hub_setup_zsh_fns () {
 6       browse:'browse the project on GitHub'
 7       compare:'open GitHub compare view'
 8       ci-status:'lookup commit in GitHub Status API'
 9+      sync:'update local branches from upstream'
10     )
11     _describe -t hub-commands 'hub command' hub_commands && ret=0
12 
13@@ -115,6 +116,7 @@ create
14 browse
15 compare
16 ci-status
17+sync
18 EOF
19     __git_list_all_commands_without_hub
20   }
21diff --git a/plugins/github/github.plugin.zsh b/plugins/github/github.plugin.zsh
22index 0ab399c979bfdabacd9c7fe56fe0c5f307cf582b..077f07bd4186da566fa5b1f09bf6cde453e7f6a1 100644
23--- a/plugins/github/github.plugin.zsh
24+++ b/plugins/github/github.plugin.zsh
25@@ -1,8 +1,6 @@
26 # Set up hub wrapper for git, if it is available; http://github.com/github/hub
27-if [ "$commands[(I)hub]" ]; then
28-  if hub --version &>/dev/null; then
29-    eval $(hub alias -s zsh)
30-  fi
31+if (( $+commands[hub] )); then
32+  alias git=hub
33 fi
34 
35 # Functions #################################################################