Class: LLM::Tool::Git::Checkout
- Inherits:
-
LLM::Tool::Git
- Object
- LLM::Tool
- LLM::Tool::Git
- LLM::Tool::Git::Checkout
- Defined in:
- lib/llm/tools/git/checkout.rb
Overview
The Checkout class implements a tool that switches branches, and restores working tree files.
Constant Summary
Constants inherited from LLM::Tool::Git
Instance Method Summary collapse
Methods inherited from LLM::Tool
NotFound, a2a, a2a?, #a2a?, abstract!, abstract?, clear_registry!, description, find_by_name!, #function, function, inherited, mcp, #mcp?, mcp?, name, #on_cancel, #on_interrupt, params, register, registry, set, subclasses, unregister
Methods included from Param
Methods included from Function::Registry
#clear_registry!, #find_by_name, #lock, #register, #registry, #registry_key, #tool_name, #unregister
Instance Method Details
#call(ref:, create: false, path: nil, timeout: DEFAULT_TIMEOUT, cwd: Dir.getwd) ⇒ Hash
28 29 30 31 32 |
# File 'lib/llm/tools/git/checkout.rb', line 28 def call(ref:, create: false, path: nil, timeout: DEFAULT_TIMEOUT, cwd: Dir.getwd) Exec .new(env:) .call(command: "git", arguments: ["-C", cwd, *parse!(ref:, create:, path:)], timeout:) end |