git.prompt.prompt_status

git.prompt

prompt_status(start_path) -> status

Get git repository status for shell prompt display

Returns a table with fields: branch, remote_branch, tag, staged, modified, untracked, ahead, behind, clean. Returns nil if not inside a git repository.

Results are debounced (at most one full computation per second) and internally cached by git-object mtimes. Call invalidate_prompt_cache() to force a fresh computation on the next call (e.g. after a command finishes).