0

I was using older version of rugged for long time and now I would like to upgrade to newest version. In development branch I've discovered that something is wrong with hunk class properties like: old_start, new_start, old_lines, new_lines - I can't access to these properties due to lack of accessors (if I understood the code correctly). Earlier those parameters were included in range property, now they were moved to separated variables, but without corresponding accessors in lib/rugged/diff/hunk.rb:

module Rugged
  class Diff
    class Hunk
      include Enumerable
      alias each each_line

      attr_reader :line_count, :header, :range, :owner

While in ext/rugged/rugged/rugged_diff_hunk.c we have:

rb_iv_set(rb_hunk, "@old_start", INT2FIX(hunk->old_start));
rb_iv_set(rb_hunk, "@old_lines", INT2FIX(hunk->old_lines));
rb_iv_set(rb_hunk, "@new_start", INT2FIX(hunk->new_start));
rb_iv_set(rb_hunk, "@new_lines", INT2FIX(hunk->new_lines));

What is also strange, there is an old accessor to property 'range', but this variable is not created anymore (in inspect method it is always printed as nil).

Is it some schedule to fix this issue already or it is not a bug and I should access new_start and old_start of hunk in some other way?

Piotr
  • 21
  • 2

1 Answers1

1

Yes, it looks like accessors for those instance variable are missing. Would you mind opening a ticket on the Github issue tracker for rugged at: https://github.com/libgit2/rugged/issues