Skip to content

armgit / orca

Public Imported from GitHub
0

Orca is the place for working with a fleet of agents (e.g. Grok Bot, Claude Code). Run any coding agent with your own subscription. Available on desktop, mobile and remote runtime.

722 B
Raw Blame
type GitStatusLineStatEntry = {
  area?: unknown
  path?: unknown
}

export type GitStatusLineStatInputs = {
  hasStaged: boolean
  hasUnstaged: boolean
  untrackedPaths: string[]
}

export function collectGitStatusLineStatInputs(
  entries: readonly GitStatusLineStatEntry[]
): GitStatusLineStatInputs {
  let hasStaged = false
  let hasUnstaged = false
  const untrackedPaths: string[] = []

  for (const entry of entries) {
    const area = entry.area
    if (area === 'staged') {
      hasStaged = true
    } else if (area === 'unstaged') {
      hasUnstaged = true
    } else if (area === 'untracked') {
      untrackedPaths.push(entry.path as string)
    }
  }

  return { hasStaged, hasUnstaged, untrackedPaths }
}