working on CheckDirty()
Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
parent
269ff54715
commit
b2c21e8c16
15
git.go
15
git.go
|
@ -89,16 +89,23 @@ func (rs *RepoStatus) getBranches() []string {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (rs *RepoStatus) CheckDirty() bool {
|
func (rs *RepoStatus) CheckDirty() bool {
|
||||||
out := run(rs.repopath, "git", "diff-index HEAD")
|
cmd := []string{"git", "diff-index", "--quiet", "HEAD"}
|
||||||
if out == "" {
|
err, b, out := RunCmd("/home/jcarr/go/src/" + rs.repopath, cmd)
|
||||||
|
if err != nil {
|
||||||
|
log.Warn("CheckDirty() err =", err)
|
||||||
|
log.Error(err, "CheckDirty() error")
|
||||||
|
rs.dirtyLabel.Set("error")
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
log.Warn("CheckDirty() b =", b, "out =", out)
|
||||||
|
if b {
|
||||||
log.Warn("CheckDirty() no", rs.repopath)
|
log.Warn("CheckDirty() no", rs.repopath)
|
||||||
rs.dirtyLabel.Set("no")
|
rs.dirtyLabel.Set("no")
|
||||||
return false
|
return false
|
||||||
} else {
|
}
|
||||||
log.Warn("CheckDirty() true", rs.repopath)
|
log.Warn("CheckDirty() true", rs.repopath)
|
||||||
rs.dirtyLabel.Set("dirty")
|
rs.dirtyLabel.Set("dirty")
|
||||||
return true
|
return true
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue