Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rugged::TreeError when running against newly added files #291

Open
apiology opened this issue Apr 14, 2018 · 4 comments
Open

Rugged::TreeError when running against newly added files #291

apiology opened this issue Apr 14, 2018 · 4 comments

Comments

@apiology
Copy link
Contributor

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
@t3hk0d3
Copy link

t3hk0d3 commented Sep 6, 2018

Same.

I wonder how did this bug got into release, coz it is quite trivial.

@printercu
Copy link

Seems like it's fixed in 005ca38

@waterjump
Copy link

It looks like we have to wait til the next version bump, or use a fork until then.

@ashkulz
Copy link
Member

ashkulz commented Aug 5, 2019

I think the fix is included in v0.10.0, which was released on Feb 3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants