Commit 013216d53fb751f697a428b3794f7aaecc7066b2

Authored by Shrikant Sharat

Merge branch 'master' of https://github.com/Tarrasch/antigen

Conflicts:
	antigen.zsh

Showing 2 changed files Side-by-side Diff

... ... @@ -197,7 +197,11 @@ antigen-update () {
197 197  
198 198 # If its a specific branch that we want, checkout that branch.
199 199 if [[ $url == *\|* ]]; then
200   - Git checkout "${url#*|}"
  200 + local current_branch=${$(Git symbolic-ref HEAD)##refs/heads/}
  201 + local requested_branch="${url#*|}"
  202 + # Only do the checkout when we are not already on the branch
  203 + [[ $requested_branch != $current_branch ]] &&
  204 + Git checkout $requested_branch
201 205 fi
202 206  
203 207 if ! [[ -z $old_rev || $old_rev == $new_rev ]]; then
tests/branch-bundle.t
... ... @@ -25,6 +25,10 @@ Load plugin from b1.
25 25 $ hehe
26 26 hehe from b1
27 27  
  28 +Does not say 'Already on b1' on each session startup.
  29 +
  30 + $ antigen-bundle $PLUGIN_DIR --branch=b1
  31 +
28 32 Load plugin from master.
29 33  
30 34 $ antigen-bundle $PLUGIN_DIR