report dirty state change
Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
parent
ddd95e9afc
commit
ccee573364
11
git.go
11
git.go
|
@ -2,6 +2,7 @@ package repostatus
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
|
"fmt"
|
||||||
"os/user"
|
"os/user"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
@ -195,6 +196,7 @@ func (rs *RepoStatus) IsDirty() bool {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (rs *RepoStatus) CheckDirty() bool {
|
func (rs *RepoStatus) CheckDirty() bool {
|
||||||
|
var start string = rs.dirtyLabel.String()
|
||||||
cmd := []string{"git", "status"}
|
cmd := []string{"git", "status"}
|
||||||
path := rs.realPath.String()
|
path := rs.realPath.String()
|
||||||
err, b, out := RunCmd(path, cmd)
|
err, b, out := RunCmd(path, cmd)
|
||||||
|
@ -206,6 +208,9 @@ func (rs *RepoStatus) CheckDirty() bool {
|
||||||
log.Warn("CheckDirty() status err =", err)
|
log.Warn("CheckDirty() status err =", err)
|
||||||
log.Error(err, "CheckDirty() git status error")
|
log.Error(err, "CheckDirty() git status error")
|
||||||
rs.dirtyLabel.SetValue("error")
|
rs.dirtyLabel.SetValue("error")
|
||||||
|
if start != "error" {
|
||||||
|
rs.NoteChange("repo git status is in error " + fmt.Sprint(err))
|
||||||
|
}
|
||||||
rs.dirty = true
|
rs.dirty = true
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
@ -216,6 +221,9 @@ func (rs *RepoStatus) CheckDirty() bool {
|
||||||
log.Log(INFO, "CheckDirty() b =", b, "path =", path, "out =", out)
|
log.Log(INFO, "CheckDirty() b =", b, "path =", path, "out =", out)
|
||||||
log.Log(INFO, "CheckDirty() no", rs.realPath.String())
|
log.Log(INFO, "CheckDirty() no", rs.realPath.String())
|
||||||
rs.dirtyLabel.SetValue("no")
|
rs.dirtyLabel.SetValue("no")
|
||||||
|
if start != "no" {
|
||||||
|
rs.NoteChange("repo is no longer dirty")
|
||||||
|
}
|
||||||
rs.dirty = false
|
rs.dirty = false
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
@ -229,6 +237,9 @@ func (rs *RepoStatus) CheckDirty() bool {
|
||||||
log.Log(INFO, "CheckDirty() is normal err =", err)
|
log.Log(INFO, "CheckDirty() is normal err =", err)
|
||||||
|
|
||||||
rs.dirtyLabel.SetValue("dirty")
|
rs.dirtyLabel.SetValue("dirty")
|
||||||
|
if start != "dirty" {
|
||||||
|
rs.NoteChange("repo is now dirty")
|
||||||
|
}
|
||||||
rs.dirty = true
|
rs.dirty = true
|
||||||
return true
|
return true
|
||||||
|
|
||||||
|
|
10
merge.go
10
merge.go
|
@ -16,6 +16,16 @@ func (rs *RepoStatus) IsUserBranch() bool {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (rs *RepoStatus) DeleteUserBranch(force bool) bool {
|
||||||
|
log.Log(REPOWARN, "figure out what to do here")
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
func (rs *RepoStatus) ResetBranches() bool {
|
||||||
|
log.Log(REPOWARN, "figure out what to do here")
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
func (rs *RepoStatus) MergeUserToDevel() bool {
|
func (rs *RepoStatus) MergeUserToDevel() bool {
|
||||||
startbranch := rs.GetCurrentBranchName()
|
startbranch := rs.GetCurrentBranchName()
|
||||||
devel := rs.GetDevelBranchName()
|
devel := rs.GetDevelBranchName()
|
||||||
|
|
Loading…
Reference in New Issue