summaryrefslogtreecommitdiff
path: root/git.go
diff options
context:
space:
mode:
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
}