From 0ad6c549d3342f6a0fc8aaa7ca1251f367bdb98d Mon Sep 17 00:00:00 2001 From: Paul Lorenz Date: Mon, 16 Nov 2020 16:55:24 -0500 Subject: [PATCH] Add some debug to get branch name --- cmd/common.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmd/common.go b/cmd/common.go index 57bc38e..829b0ec 100644 --- a/cmd/common.go +++ b/cmd/common.go @@ -285,6 +285,10 @@ func (cmd *BaseCommand) GetCurrentBranch() string { branchName = cmd.GetCmdOutputOneLine("get git branch (rev-parse)", "git", "rev-parse", "--abbrev-ref", "HEAD") if branchName == "HEAD" { branchName = cmd.GetCmdOutputOneLine("get git branch (name-rev)", "git", "name-rev", "--name-only", "HEAD") + cmd.Infof("git name-rev returned %v\n", branchName) + if strings.HasPrefix(branchName, "/remotes/origin/") { + branchName = strings.TrimPrefix(branchName, "/remotes/origin/") + } } } cmd.CurrentBranch = &branchName