summaryrefslogtreecommitdiff
path: root/plugins/branch
diff options
context:
space:
mode:
authorswivelmargarita <55573157+swivelmargarita@users.noreply.github.com>2025-04-17 19:57:53 +0500
committerGitHub <noreply@github.com>2025-04-17 16:57:53 +0200
commitc1e5ff31693f391a0bbb30b12c8e7bc1cc976b7b (patch)
treed469b3ea73f808706ce49d12f28e532b2476fde3 /plugins/branch
parenta84a0332a822a78ddf3f66d0e1ed3990d4badd12 (diff)
downloadzsh-c1e5ff31693f391a0bbb30b12c8e7bc1cc976b7b.tar.gz
zsh-c1e5ff31693f391a0bbb30b12c8e7bc1cc976b7b.tar.bz2
zsh-c1e5ff31693f391a0bbb30b12c8e7bc1cc976b7b.zip
fix(branch): handle branches with `/` properly (#13063)
Co-authored-by: Takha Polat <takha.polat@bell-sw.com>
Diffstat (limited to 'plugins/branch')
-rw-r--r--plugins/branch/branch.plugin.zsh2
1 files changed, 1 insertions, 1 deletions
diff --git a/plugins/branch/branch.plugin.zsh b/plugins/branch/branch.plugin.zsh
index dd5871fdc..c24f9098e 100644
--- a/plugins/branch/branch.plugin.zsh
+++ b/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