mirror of
https://github.com/robbyrussell/oh-my-zsh.git
synced 2026-11-30 04:13:06 +01:00
`_omz_git_prompt_info` ran `git rev-parse --git-dir` and then `git symbolic-ref --short HEAD` as two separate processes. Ask for both in one `git rev-parse --git-dir --abbrev-ref HEAD` call; a detached HEAD prints "HEAD" and falls through to the tag/SHA lookups as before, and an unborn branch (exit 128 after printing the git dir) falls back to `symbolic-ref` so freshly initialised repositories still show their branch. `parse_git_dirty` piped `git status --porcelain` through `tail -n 1`, but only tests whether the output is empty, so the pipe is dropped. Output verified identical for: outside a repo, unborn, unborn with staged files, clean, dirty, detached, detached on a tag, hide-info, hide-dirty, subdirectory. Two fewer forks per prompt; ~13 ms less on macOS arm64 for a clean branch. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>