Module: Ace::Git::Molecules::GitStatusFetcher

Defined in:
lib/ace/git/molecules/git_status_fetcher.rb

Overview

Fetches git status information via system command Uses git status -sb for compact, familiar output

Note: Moved from Atoms to Molecules per ATOM architecture - executing system commands is I/O, which belongs in Molecules layer.

Class Method Summary collapse

Class Method Details

.fetch_status_sb(executor: Atoms::CommandExecutor) ⇒ Hash

Fetch git status in short branch format

Parameters:

  • executor (CommandExecutor) (defaults to: Atoms::CommandExecutor)

    Command executor (default: CommandExecutor)

Returns:

  • (Hash)

    Result with :success, :output, :error



16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/ace/git/molecules/git_status_fetcher.rb', line 16

def fetch_status_sb(executor: Atoms::CommandExecutor)
  # Disable color to ensure clean output for LLM context
  result = executor.execute("git", "-c", "color.status=false", "status", "-sb")

  if result[:success]
    {success: true, output: result[:output].strip}
  else
    {success: false, output: "", error: result[:error]}
  end
rescue => e
  {success: false, output: "", error: e.message}
end