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.

591 B
Raw Blame
import type { GitStatusEntry } from './git-status-types'
import { compareFileNames } from './file-name-sort'

export function compareGitStatusEntries(a: GitStatusEntry, b: GitStatusEntry): number {
  // Use compareFileNames to break numeric ties (2/02) consistently with File Explorer.
  return getConflictSortRank(a) - getConflictSortRank(b) || compareFileNames(a.path, b.path)
}

function getConflictSortRank(entry: GitStatusEntry): number {
  if (entry.conflictStatus === 'unresolved') {
    return 0
  }
  if (entry.conflictStatus === 'resolved_locally') {
    return 1
  }
  return 2
}