Commit 549f113930b5332ce74cb0c2494394c743b41d07

Authored by Pavel Repin
1 parent c3808d88b6

Don't die if HEAD ref is not symbolic.

Examples of situations when HEAD is not symbolic:

 * You're doing interactive rebase
 * You're using git bisect
 * ... and so on.

Showing 1 changed file with 5 additions and 2 deletions Side-by-side Diff

... ... @@ -39,9 +39,12 @@
39 39 upstream_changes = `git rev-list --count master..origin/master`.chomp != '0'
40 40 fast_forwardable = `git rev-list --count origin/master..master`.chomp == '0'
41 41  
42   - short_branch = current_branch.split('/')[2..-1].join('/')
43   -
44 42 if !master
  43 + short_branch = if current_branch.empty?
  44 + `git log -1 --pretty=format:%h`
  45 + else
  46 + current_branch.split('/')[2..-1].join('/')
  47 + end
45 48 warn "Boxen on a non-master branch '#{short_branch}', won't auto-update!"
46 49 elsif !fast_forwardable
47 50 warn "Boxen's master branch is out of sync, won't auto-update!"