pgr0ss / rake_commit

A program that helps with checking in code. It automates common git or svn commands.
13 stars 13 forks source link

raising wrong exception when system command fails #5

Open pitluga opened 12 years ago

pitluga commented 12 years ago

We see this method when a push is rejected on jruby 1.6.7.2

sanitized output:

Finished in 57.77 seconds 743 examples, 0 failures, 5 pending To git@example.com:repo.git ! [rejected] master -> master (non-fast-forward) error: failed to push some refs to 'git@example.com:repo.git' To prevent you from losing history, non-fast-forward updates were rejected Merge the remote changes (e.g. 'git pull') before pushing again. See the 'Note about fast-forwards' section of 'git push --help' for details. RuntimeError: No current exception

RuntimeError: No current exception system at ruby/gems/1.8/gems/rake_commit-0.11.0/lib/shell.rb:6 push at ruby/gems/1.8/gems/rake_commit-0.11.0/lib/git.rb:63 commit at ruby/gems/1.8/gems/rake_commit-0.11.0/lib/git.rb:15 commit at ruby/gems/1.8/gems/rake_commit-0.11.0/lib/commit.rb:47 (root) at ruby/gems/1.8/gems/rake_commit-0.11.0/bin/rake_commit: load at org/jruby/RubyKernel.java:1068 (root) at bin/rake_commit:23

the code just does a plain raise instead of passing a string. This causes an exception since their is no current exception to re-raise. You get the desired behavior, just a weird error.