zsh-workers
 help / color / mirror / code / Atom feed
* [PATCH] vcs_info git: Compute %b correctly with "rebase --onto" of detached heads.  (Follow-up to 36725.)
@ 2015-11-30  3:23 Daniel Shahaf
  0 siblings, 0 replies; only message in thread
From: Daniel Shahaf @ 2015-11-30  3:23 UTC (permalink / raw)
  To: zsh-workers

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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-11-30  3:32 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-30  3:23 [PATCH] vcs_info git: Compute %b correctly with "rebase --onto" of detached heads. (Follow-up to 36725.) Daniel Shahaf

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).