From 8ce9c1cbe7c7d1abd0f8b4ddc879b606ce9505a8 Mon Sep 17 00:00:00 2001 From: Frank Terbeck Date: Wed, 19 Oct 2011 18:14:08 +0000 Subject: Suraj N. Kurapati: vcs_info-examples: Mention different ways to handle remote branch names in `vi-git-remotebranch()'. --- Misc/vcs_info-examples | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'Misc') diff --git a/Misc/vcs_info-examples b/Misc/vcs_info-examples index 860297c9e..ba3b2c367 100644 --- a/Misc/vcs_info-examples +++ b/Misc/vcs_info-examples @@ -205,7 +205,11 @@ function +vi-git-remotebranch() { remote=${$(git rev-parse --verify ${hook_com[branch]}@{upstream} \ --symbolic-full-name 2>/dev/null)/refs\/remotes\/} + # The first test will show a tracking branch whenever there is one. The + # second test, however, will only show the remote branch's name if it + # differs from the local one. if [[ -n ${remote} ]] ; then + #if [[ -n ${remote} && ${remote#*/} != ${hook_com[branch]} ]] ; then hook_com[branch]="${hook_com[branch]} [${remote}]" fi } -- cgit 1.4.1