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
|
while [[ "$dir" != '/' ]]; do
|
||||||
# Found .git directory
|
# Found .git directory
|
||||||
if [[ -d "${dir}/.git" ]]; then
|
if [[ -d "${dir}/.git" ]]; then
|
||||||
branch="${"$(<"${dir}/.git/HEAD")"##*/}"
|
branch="${"$(<"${dir}/.git/HEAD")"##ref: refs/heads/}"
|
||||||
echo '±' "${branch:gs/%/%%}"
|
echo '±' "${branch:gs/%/%%}"
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user