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.
Class Method Summary collapse
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 |
Class Method Details
.finalize(ptr) ⇒ Object
21 22 23 |
# File 'lib/simple_git/diff.rb', line 21 def self.finalize(ptr) proc { Git2.git_diff_free(ptr) } end |
Instance Method Details
#from_trees(repo, old_tree, new_tree, options) ⇒ Object
5 6 7 8 9 10 11 12 13 |
# File 'lib/simple_git/diff.rb', line 5 def from_trees(repo, old_tree, new_tree, ) wrapper = DiffWrapper.new Git2.git_diff_tree_to_tree(wrapper, repo.ptr, old_tree.ptr, new_tree.ptr, .ptr) @ptr = wrapper[:diff] ObjectSpace.define_finalizer(self, self.class.finalize(@ptr)) self end |