diff options
| author | Jeff Carr <[email protected]> | 2024-01-25 02:23:56 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-01-25 02:23:56 -0600 |
| commit | 86136ce6152d2125a53fa98adb6e6ed4db949190 (patch) | |
| tree | 25131c5dc1c0fa7f10ee9a30c894d1d185db9e6f /git.go | |
| parent | 4beeb0bb137bf179064354fa6fc3be2c951bdef6 (diff) | |
avoid a few nil'sv0.13.4
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'git.go')
| -rw-r--r-- | git.go | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -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") |
