mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-01-23 02:35:38 +01:00
branch: output branch names with '/' correctly
This commit is contained in:
parent
750d3ac4b4
commit
e28660d071
1 changed files with 1 additions and 1 deletions
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue