Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
[PATCH] vcs_info git: Compute %b correctly with "rebase --onto" of detached heads. (Follow-up to 36725.)
- X-seq: zsh-workers 37252
- From: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: [PATCH] vcs_info git: Compute %b correctly with "rebase --onto" of detached heads. (Follow-up to 36725.)
- Date: Mon, 30 Nov 2015 03:23:57 +0000
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= daniel.shahaf.name; h=content-type:date:from:message-id :mime-version:subject:to:x-sasl-enc:x-sasl-enc; s=mesmtp; bh=0oO Huh4ZQWacqwqi2/wPpRYk3a4=; b=jTzHv7r68blsdtmBomGd9l2EoCqRDCg/Dn1 cdTm5ZvArDxH1Fx9rw2nXi1NNVfMmYBxb2e3euK7MzxEiO8BxHL/Lf9tEFqn3Net VMkmLFk5Lt+YXrfjb0O+pJKG0AREeZxe9Bxs7JOQN4PAxIVLoUFbVMQt2WSV7oIU OIRKNUM0=
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:message-id :mime-version:subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=0o OHuh4ZQWacqwqi2/wPpRYk3a4=; b=MZMXZa8RyQhtkHABLe38w8+dmuR8vaqsYP 9W/TTCAluHa0lHr7fxVpa89xCBGOQdLWXirdMcA+7c7QMQNrth/wow1ILvfRlCCM QT0oNGcrQY1p6yhcFGuaiH+U+mbs9/Vkpexor4XXrxDUDFaxCPtoe7Qewr/tW3p/ d44sR8rJw=
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
---
Besides .git/ORIG_HEAD there is also .git/rebase-apply/orig-head, I'm
not sure if one of those should be preferred over the other.
Functions/VCS_Info/Backends/VCS_INFO_get_data_git | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/Functions/VCS_Info/Backends/VCS_INFO_get_data_git b/Functions/VCS_Info/Backends/VCS_INFO_get_data_git
index 704c189..e1cee74 100644
--- a/Functions/VCS_Info/Backends/VCS_INFO_get_data_git
+++ b/Functions/VCS_Info/Backends/VCS_INFO_get_data_git
@@ -87,7 +87,8 @@ VCS_INFO_git_getbranch () {
gitbranch="$(${(z)gitsymref} 2> /dev/null)"
[[ -z ${gitbranch} ]] && [[ -r ${actiondir}/head-name ]] \
&& gitbranch="$(< ${actiondir}/head-name)"
- [[ -z ${gitbranch} ]] && gitbranch="$(< ${gitdir}/ORIG_HEAD)"
+ [[ -z ${gitbranch} || ${gitbranch} == 'detached HEAD' ]] \
+ && gitbranch="$(< ${gitdir}/ORIG_HEAD)"
elif [[ -f "${gitdir}/MERGE_HEAD" ]] ; then
gitbranch="$(${(z)gitsymref} 2> /dev/null)"
--
2.1.4
Messages sorted by:
Reverse Date,
Date,
Thread,
Author