summaryrefslogtreecommitdiff
path: root/git.go
diff options
context:
space:
mode:
Diffstat (limited to 'git.go')
-rw-r--r--git.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/git.go b/git.go
index 67def68..a004ef2 100644
--- a/git.go
+++ b/git.go
@@ -153,6 +153,20 @@ func (rs *RepoStatus) checkoutBranch(level string, branch string) {
}
func (rs *RepoStatus) SetMainWorkingName(s string) {
+ if rs == nil {
+ log.Info("rs == nil", s)
+ return
+ }
+ if rs.gitConfig == nil {
+ log.Info("rs.gitConfig == nil", s)
+ rs.mainWorkingName.SetValue(s)
+ return
+ }
+ if rs.gitConfig.branches == nil {
+ log.Info("rs.gitConfig.branches == nil", s)
+ rs.mainWorkingName.SetValue(s)
+ return
+ }
_, ok := rs.gitConfig.branches[s]
if ok {
log.Info("git branch", s, "seems to exist")