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.
This commit is contained in:
parent
c3808d88b6
commit
549f113930
1 changed files with 5 additions and 2 deletions
|
@ -39,9 +39,12 @@ unless ENV["BOXEN_NO_PULL"] || ARGV.include?("--no-pull")
|
||||||
upstream_changes = `git rev-list --count master..origin/master`.chomp != '0'
|
upstream_changes = `git rev-list --count master..origin/master`.chomp != '0'
|
||||||
fast_forwardable = `git rev-list --count origin/master..master`.chomp == '0'
|
fast_forwardable = `git rev-list --count origin/master..master`.chomp == '0'
|
||||||
|
|
||||||
short_branch = current_branch.split('/')[2..-1].join('/')
|
|
||||||
|
|
||||||
if !master
|
if !master
|
||||||
|
short_branch = if current_branch.empty?
|
||||||
|
`git log -1 --pretty=format:%h`
|
||||||
|
else
|
||||||
|
current_branch.split('/')[2..-1].join('/')
|
||||||
|
end
|
||||||
warn "Boxen on a non-master branch '#{short_branch}', won't auto-update!"
|
warn "Boxen on a non-master branch '#{short_branch}', won't auto-update!"
|
||||||
elsif !fast_forwardable
|
elsif !fast_forwardable
|
||||||
warn "Boxen's master branch is out of sync, won't auto-update!"
|
warn "Boxen's master branch is out of sync, won't auto-update!"
|
||||||
|
|
Loading…
Reference in a new issue