Browse Source

fix(branch): handle branches with `/` properly (#13063)

Co-authored-by: Takha Polat <takha.polat@bell-sw.com>
swivelmargarita 1 day ago
parent
commit
c1e5ff3169
1 changed files with 1 additions and 1 deletions
  1. 1 1
      plugins/branch/branch.plugin.zsh

+ 1 - 1
plugins/branch/branch.plugin.zsh

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