branch: output branch names with '/' correctly

This commit is contained in:
Takha Polat 2025-04-12 18:10:09 +05:00
commit e28660d071

View file

@ -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