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::Diff::Line#hunk always returns nil #390

Closed
mmozuras opened this issue Jul 13, 2014 · 5 comments · Fixed by #393
Closed

Rugged::Diff::Line#hunk always returns nil #390

mmozuras opened this issue Jul 13, 2014 · 5 comments · Fixed by #393

Comments

@mmozuras
Copy link
Contributor

Rugged::Diff::Line#hunk or (#owner) seems to always returns nil. How to reproduce:

irb(main):001:0> require 'rugged'
=> true
irb(main):002:0> repo = Rugged::Repository.new('.')
=> #<Rugged::Repository:70098604661600 {path: "/Users/mindaugasmozuras/Projects/rugged/.git/"}>
irb(main):003:0> diff = repo.diff('HEAD', 'HEAD~1')
=> #<Rugged::Diff:0x007f8234db3400 @owner=Rugged::Tree>
irb(main):004:0> diff.each_line.map { |line| line.hunk.class }
=> [NilClass, NilClass, NilClass, NilClass]

Seems to be introduced with this commit. /cc @arthurschreiber

@arthurschreiber
Copy link
Member

Do you need this functionality, or can I remove the #hunk method. It's basically a leftover.

@arthurschreiber
Copy link
Member

Actually, I'll have to remove it, because #each_line does not generate hunk information, and thus it won't be available in all cases. That's why I removed it in the first place. Thanks for pointing this out! 😄

@mmozuras
Copy link
Contributor Author

@arthurschreiber no problem 😄

@arthurschreiber
Copy link
Member

Does #393 look good to you?

@mmozuras
Copy link
Contributor Author

@arthurschreiber yes, it does.

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

Successfully merging a pull request may close this issue.

2 participants