Class: SimpleGit::Diff
- Inherits:
-
Object
- Object
- SimpleGit::Diff
- Defined in:
- lib/simple_git/diff.rb
Defined Under Namespace
Classes: DiffWrapper
Instance Attribute Summary collapse
-
#ptr ⇒ Object
Returns the value of attribute ptr.
Instance Method Summary collapse
Instance Attribute Details
#ptr ⇒ Object
Returns the value of attribute ptr.
3 4 5 |
# File 'lib/simple_git/diff.rb', line 3 def ptr @ptr end |
Instance Method Details
#from_trees(repo, old_tree, new_tree, options) ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/simple_git/diff.rb', line 5 def from_trees(repo, old_tree, new_tree, ) wrapper = DiffWrapper.new ret = Git2.git_diff_tree_to_tree(wrapper, repo.ptr, old_tree.ptr, new_tree.ptr, .ptr) if ret != 0 error = Git2::GitError.new(Git2.giterr_last) raise ArgumentError, error[:message].read_string end @ptr = wrapper[:diff] ObjectSpace.define_finalizer(self, self.class.finalize(@ptr)) self end |