-
Notifications
You must be signed in to change notification settings - Fork 533
Diff fails with NoMethodError: undefined method '[]' for nil:NilClass
when line ending warnings are emitted
#326
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
Comments
NoMethodError: undefined method
[]' for nil:NilClass` when line ending warnings are emittedNoMethodError: undefined method '[]' for nil:NilClass
when line ending warnings are emitted
May be related to #326 |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Given we still have a monkey patch in voxpupuli's modulesync I think this isn't resolved and should be reopened. |
Seems to be fixed with PR #405. |
neomilium
added a commit
to opus-codium/modulesync
that referenced
this issue
Dec 20, 2020
According to ruby-git/ruby-git#405, it seems to close the issue reported at ruby-git/ruby-git#326. This have been merged then released in 1.7.0. It finally removes the deprecation warning: lib/monkey_patches.rb:13: warning: Using the last argument as keyword parameters is deprecated
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Repro case:
NoMethodError: undefined method '[]' for nil:NilClass
error in methodprocess_full_diff
Example output;
The reason it fails because the code at; https://github.com/schacon/ruby-git/blob/master/lib/git/diff.rb#L139-L151 expects the first line to contain the filename whereas raw diff comes back as;
Suggested fix:
I suggest the line at https://github.com/schacon/ruby-git/blob/master/lib/git/diff.rb#L138 be changed from
else
toelsif !current_file.nil?
so that it won't process diff text until a valid filename is detectedThe text was updated successfully, but these errors were encountered: