Commit ccc3d14430859626a72750d9d29e6eefc7f413e8
1 parent
f71e897ffa
Stop saying "already on branch" for new sessions
Showing 2 changed files with 9 additions and 1 deletions Side-by-side Diff
antigen.zsh
... | ... | @@ -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