summaryrefslogtreecommitdiff
path: root/git.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-01-09 09:56:33 -0600
committerJeff Carr <[email protected]>2024-01-09 09:56:33 -0600
commit0d01d8276659a0ed56827f23e41fc0b0a7304f83 (patch)
treef75f1d951415f632b0fc651357a293b2a32c573a /git.go
parent1f52d3083efb7768b8d7e21c7b9761c029b62584 (diff)
gets jcarr,devel and master branch info
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'git.go')
-rw-r--r--git.go26
1 files changed, 19 insertions, 7 deletions
diff --git a/git.go b/git.go
index bc7b283..75f4618 100644
--- a/git.go
+++ b/git.go
@@ -12,12 +12,24 @@ import (
)
func (r *repo) checkoutBranch(branch string) {
- if ! r.checkDirty() {
- out := run(r.path, "git", "checkout " + branch)
- log.Warn(r.path, "git checkout " + branch, "returned", out)
+ if r.checkDirty() {
+ return
+ }
+ out := run(r.path, "git", "checkout " + branch)
+ log.Warn(r.path, "git checkout " + branch, "returned", out)
+
+ realname := r.getCurrentBranchName()
+ realversion := r.getCurrentBranchVersion()
+ log.Warn(r.path, "realname =", realname, "realversion =", realversion)
+ if realname == "jcarr" {
+ r.jcarrVersion.Set(realversion)
+ }
+ if realname == "devel" {
+ r.develVersion.Set(realversion)
+ }
+ if realname == "master" {
+ r.masterVersion.Set(realversion)
}
- r.getCurrentBranchName()
- r.getCurrentBranchVersion()
}
func (r *repo) getBranch() {
@@ -28,11 +40,11 @@ func (r *repo) getBranch() {
func (r *repo) checkDirty() bool {
out := run(r.path, "git", "diff-index HEAD")
if out == "" {
- r.sLabel.SetText("")
+ r.dirtyLabel.SetText("")
r.pButton.Disable()
return false
} else {
- r.sLabel.SetText("dirty")
+ r.dirtyLabel.SetText("dirty")
r.pButton.Enable()
return true
}