You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are several methods in HerokuSan::Git that either silently ignore git errors or throw unexpected exceptions. All examples assume the following object:
>> git = Object.new.extend(HerokuSan::Git)
If git command in git_active_branch fails a NoMethodError is thrown
>> Dir.chdir("/tmp")
>> git.git_active_branch
NoMethodError: undefined method `split' for nil:NilClass
from /Users/jturkel/.rvm/gems/ruby-2.0.0-p481@dandelion/gems/heroku_san-4.3.2/lib/heroku_san/git.rb:15:in `git_active_branch'
If the git command fails in git_rev_parse the first line of the ref arg is returned:
>> git.git_rev_parse("bad")
"bad"
If the git command fails in git_revisionnil is returned:
>> git.git_revision('bad-repo')
nil
If the git command fails in git_named_rev an empty string is returned:
>> git.git_named_rev('bad-ref')
""
Note in all cases the git error is echoed to stderr but scripts using this module will continue happily running when they should fail.
The text was updated successfully, but these errors were encountered:
There are several methods in
HerokuSan::Git
that either silently ignore git errors or throw unexpected exceptions. All examples assume the following object:git_active_branch
fails aNoMethodError
is throwngit_rev_parse
the first line of theref
arg is returned:git_revision
nil
is returned:git_named_rev
an empty string is returned:Note in all cases the git error is echoed to stderr but scripts using this module will continue happily running when they should fail.
The text was updated successfully, but these errors were encountered: