Minga.Project.FileTree.GitStatus (Minga v0.1.0)

Copy Markdown View Source

Builds file-tree git badge maps from already-fetched repo status entries.

This module never shells out to git. Minga.Git.Repo owns fetching and caching repo status; the file tree consumes those cached entries and converts them into %{absolute_path => status_atom} maps. Directory entries inherit the most severe descendant status so collapsed directories still show useful badges.

Summary

Types

Git status for a single file.

Status map keyed by absolute file path.

Functions

Builds file-tree git status from an already-fetched git status event.

Returns the severity rank for a status (higher = more urgent). Used for directory propagation: the "worst" child status wins.

Returns the display symbol for a git status.

Types

file_status()

@type file_status() ::
  :staged | :modified | :untracked | :conflict | :renamed | :deleted

Git status for a single file.

status_map()

@type status_map() :: %{required(String.t()) => file_status()}

Status map keyed by absolute file path.

Functions

from_entries(entries, git_root, root_path)

@spec from_entries([Minga.Git.status_entry()], String.t(), String.t()) :: status_map()

Builds file-tree git status from an already-fetched git status event.

This lets event handlers refresh badges without shelling out during render or recomputing status that Minga.Git.Repo already fetched.

severity(atom)

@spec severity(file_status()) :: non_neg_integer()

Returns the severity rank for a status (higher = more urgent). Used for directory propagation: the "worst" child status wins.

symbol(atom)

@spec symbol(file_status()) :: String.t()

Returns the display symbol for a git status.