pronto
pronto copied to clipboard
Rugged::TreeError when running against newly added files
How to reproduce:
Stage a new file in git that should be analyzed (e.g., a Ruby file) and run pronto, asking for results on staged tree:
echo 'hi' > foo.rb
git add foo.rb
pronto run -c origin/master --no-exit-code --staged
Expected result:
New file is analyzed
Observed result:
/Users/broz/.rvm/gems/ruby-2.4.0/gems/pronto-0.9.5/lib/pronto/git/repository.rb:52:in `new': the path 'check_weight_filter.rb' does not exist in the given tree (Rugged::TreeError)
from /Users/broz/.rvm/gems/ruby-2.4.0/gems/pronto-0.9.5/lib/pronto/git/repository.rb:52:in `blame'
from /Users/broz/.rvm/gems/ruby-2.4.0/gems/pronto-0.9.5/lib/pronto/git/patch.rb:17:in `blame'
from /Users/broz/.rvm/gems/ruby-2.4.0/gems/pronto-0.9.5/lib/pronto/git/line.rb:45:in `blame'
from /Users/broz/.rvm/gems/ruby-2.4.0/gems/pronto-0.9.5/lib/pronto/git/line.rb:20:in `commit_sha'
from /Users/broz/.rvm/gems/ruby-2.4.0/gems/pronto-0.9.5/lib/pronto/message.rb:18:in `initialize'
from /Users/broz/.rvm/gems/ruby-2.4.0/gems/pronto-reek-0.9.0/lib/pronto/reek.rb:35:in `new'
from /Users/broz/.rvm/gems/ruby-2.4.0/gems/pronto-reek-0.9.0/lib/pronto/reek.rb:35:in `new_message'
from /Users/broz/.rvm/gems/ruby-2.4.0/gems/pronto-reek-0.9.0/lib/pronto/reek.rb:27:in `block in messages_for'
from /Users/broz/.rvm/gems/ruby-2.4.0/gems/pronto-reek-0.9.0/lib/pronto/reek.rb:19:in `map'
from /Users/broz/.rvm/gems/ruby-2.4.0/gems/pronto-reek-0.9.0/lib/pronto/reek.rb:19:in `messages_for'
from /Users/broz/.rvm/gems/ruby-2.4.0/gems/pronto-reek-0.9.0/lib/pronto/reek.rb:13:in `run'
from /Users/broz/.rvm/gems/ruby-2.4.0/gems/pronto-0.9.5/lib/pronto/runners.rb:20:in `block in run'
from /Users/broz/.rvm/gems/ruby-2.4.0/gems/pronto-0.9.5/lib/pronto/runners.rb:13:in `each'
from /Users/broz/.rvm/gems/ruby-2.4.0/gems/pronto-0.9.5/lib/pronto/runners.rb:13:in `run'
from /Users/broz/.rvm/gems/ruby-2.4.0/gems/pronto-0.9.5/lib/pronto.rb:64:in `run'
from /Users/broz/.rvm/gems/ruby-2.4.0/gems/pronto-0.9.5/lib/pronto/cli.rb:61:in `block in run'
from /Users/broz/.rvm/gems/ruby-2.4.0/gems/pronto-0.9.5/lib/pronto/cli.rb:60:in `chdir'
from /Users/broz/.rvm/gems/ruby-2.4.0/gems/pronto-0.9.5/lib/pronto/cli.rb:60:in `run'
from /Users/broz/.rvm/gems/ruby-2.4.0/gems/thor-0.19.4/lib/thor/command.rb:27:in `run'
from /Users/broz/.rvm/gems/ruby-2.4.0/gems/thor-0.19.4/lib/thor/invocation.rb:126:in `invoke_command'
from /Users/broz/.rvm/gems/ruby-2.4.0/gems/thor-0.19.4/lib/thor.rb:369:in `dispatch'
from /Users/broz/.rvm/gems/ruby-2.4.0/gems/thor-0.19.4/lib/thor/base.rb:444:in `start'
from /Users/broz/.rvm/gems/ruby-2.4.0/gems/pronto-0.9.5/bin/pronto:6:in `<top (required)>'
from /Users/broz/.rvm/gems/ruby-2.4.0/bin/pronto:22:in `load'
from /Users/broz/.rvm/gems/ruby-2.4.0/bin/pronto:22:in `<main>'
from /Users/broz/.rvm/gems/ruby-2.4.0/bin/ruby_executable_hooks:15:in `eval'
from /Users/broz/.rvm/gems/ruby-2.4.0/bin/ruby_executable_hooks:15:in `<main>'
rake aborted!
Command failed with status (1): [pronto run -c origin/master --no-exit-code...]
/Users/broz/src/vincelifedaily/Rakefile:120:in `block in <top (required)>'
/Users/broz/.rvm/gems/ruby-2.4.0/gems/rake-12.1.0/exe/rake:27:in `<top (required)>'
/Users/broz/.rvm/gems/ruby-2.4.0/bin/ruby_executable_hooks:15:in `eval'
/Users/broz/.rvm/gems/ruby-2.4.0/bin/ruby_executable_hooks:15:in `<main>'
Tasks: TOP => localtest => quality => pronto
(See full trace by running task with --trace)
Compilation exited abnormally with code 1 at Sun Oct 8 10:15:43
Same.
I wonder how did this bug got into release, coz it is quite trivial.
Seems like it's fixed in https://github.com/prontolabs/pronto/commit/005ca38e0443d1afcd7d45793cd9ac46400aeea2
It looks like we have to wait til the next version bump, or use a fork until then.
I think the fix is included in v0.10.0, which was released on Feb 3.