Class: FilesInMyDiff::Git::Adapter
- Inherits:
-
Object
- Object
- FilesInMyDiff::Git::Adapter
- Defined in:
- lib/files_in_my_diff/git/adapter.rb
Instance Method Summary collapse
- #checkout_worktree(path, revision) ⇒ Object
- #diff(revision) ⇒ Object
-
#initialize(folder:, repo: ::Git.open(folder)) ⇒ Adapter
constructor
A new instance of Adapter.
Constructor Details
Instance Method Details
#checkout_worktree(path, revision) ⇒ Object
14 15 16 17 18 19 20 21 |
# File 'lib/files_in_my_diff/git/adapter.rb', line 14 def checkout_worktree(path, revision) @repo.add_worktree(path, revision) rescue ::Git::FailedError => e unless e.result.stderr.include? 'already exists' raise CheckoutError, "Could not checkout #{revision} to #{path}: #{e.}" end end |