prezto
prezto copied to clipboard
"current git branch" breaks on specific context (not standing @ HEAD)
Description
When standing on non-HEAD master branch, display of git branch (say my-branch
) will be broken.
There are some occasions where it works (separate branch off HEAD
), but problem can be reproduced.
Expected behavior
The git branch name is displayed just fine (displays [my-branch]
in prompt)
Actual behavior
Displays a broken name in prompt, like ]
Steps to Reproduce
- Load default configuration for prezto
- Clone any repo ( say
https://github.com/sorin-ionescu/prezto.git
) - access the cloned repo (
cd prezto
) - Check the prompt displays the main branch (for prezto is
[master]
) - Stand in "not HEAD" / "one behind HEAD" (
git checkout HEAD~1
) - Check that the display is broken (displays
]
)
it seems that git symbolic-ref HEAD
command used for display is broken in this situation?
Versions
- Prezto commit: 12df1363cec395526d26c6f2be34e3013413da1e
- ZSH version: zsh 5.8.1 (x86_64-apple-darwin21.0)
- OS information: Darwin XXXXXXXXXXXXX 21.5.0 Darwin Kernel Version 21.5.0: Tue Apr 26 21:08:29 PDT 2022; root:xnu-8020.121.3~4/RELEASE_ARM64_T8101 arm64
- git version: git version 2.32.1 (Apple Git-133)