mirror of
https://github.com/robbyrussell/oh-my-zsh.git
synced 2025-12-06 07:20:40 +01:00
fix(branch): handle branches with / properly (#13063)
Co-authored-by: Takha Polat <takha.polat@bell-sw.com>
This commit is contained in:
@@ -8,7 +8,7 @@ function branch_prompt_info() {
|
||||
while [[ "$dir" != '/' ]]; do
|
||||
# Found .git directory
|
||||
if [[ -d "${dir}/.git" ]]; then
|
||||
branch="${"$(<"${dir}/.git/HEAD")"##*/}"
|
||||
branch="${"$(<"${dir}/.git/HEAD")"##ref: refs/heads/}"
|
||||
echo '±' "${branch:gs/%/%%}"
|
||||
return
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user