prezto icon indicating copy to clipboard operation
prezto copied to clipboard

"current git branch" breaks on specific context (not standing @ HEAD)

Open FelipeLema opened this issue 2 years ago • 0 comments

Description

When standing on non-HEAD master branch, display of git branch (say my-branch) will be broken.

There are some occasions where it works (separate branch off HEAD), but problem can be reproduced.

Expected behavior

The git branch name is displayed just fine (displays [my-branch] in prompt)

Actual behavior

Displays a broken name in prompt, like ]

Steps to Reproduce

  1. Load default configuration for prezto
  2. Clone any repo ( say https://github.com/sorin-ionescu/prezto.git )
  3. access the cloned repo (cd prezto)
  4. Check the prompt displays the main branch (for prezto is [master])
  5. Stand in "not HEAD" / "one behind HEAD" (git checkout HEAD~1)
  6. Check that the display is broken (displays ])

it seems that git symbolic-ref HEAD command used for display is broken in this situation?

Versions

  • Prezto commit: 12df1363cec395526d26c6f2be34e3013413da1e
  • ZSH version: zsh 5.8.1 (x86_64-apple-darwin21.0)
  • OS information: Darwin XXXXXXXXXXXXX 21.5.0 Darwin Kernel Version 21.5.0: Tue Apr 26 21:08:29 PDT 2022; root:xnu-8020.121.3~4/RELEASE_ARM64_T8101 arm64
  • git version: git version 2.32.1 (Apple Git-133)

FelipeLema avatar Jul 04 '22 19:07 FelipeLema