summaryrefslogtreecommitdiff
path: root/git.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-01-26 11:53:22 -0600
committerJeff Carr <[email protected]>2024-01-26 11:53:22 -0600
commit386125826f5e8fb9e2dd9ba2f4880fe0d181d29f (patch)
tree55a6a2529b9a6419cb8f168273b186521a96d073 /git.go
parent9147079092f410d9039063846118b998c10f3dda (diff)
more work on release versioningv0.13.13
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'git.go')
-rw-r--r--git.go41
1 files changed, 35 insertions, 6 deletions
diff --git a/git.go b/git.go
index 19281c8..03218ce 100644
--- a/git.go
+++ b/git.go
@@ -109,12 +109,41 @@ func (rs *RepoStatus) CheckDirty() bool {
rs.dirtyLabel.SetValue("no")
return false
}
- log.Log(INFO, "CheckDirty() true", rs.realPath.String())
- log.Log(INFO, "CheckDirty() cmd =", cmd)
- log.Log(INFO, "CheckDirty() b =", b)
- log.Log(INFO, "CheckDirty() path =", path)
- log.Log(INFO, "CheckDirty() out =", out)
- log.Log(INFO, "CheckDirty() err =", err)
+ // sometimes b gets exit status 1 when there isn't anything that has changed
+ // run git status fixes that for some reason.
+ log.Log(WARN, "CheckDirty() true", rs.realPath.String())
+ log.Log(WARN, "CheckDirty() cmd =", cmd)
+ log.Log(WARN, "CheckDirty() b =", b)
+ log.Log(WARN, "CheckDirty() path =", path)
+ log.Log(WARN, "CheckDirty() out =", out)
+ log.Log(WARN, "CheckDirty() err =", err)
+
+ cmd = []string{"git", "status"}
+ err, b, out = RunCmd(path, cmd)
+
+ log.Log(WARN, "CheckDirty() true", rs.realPath.String())
+ log.Log(WARN, "CheckDirty() cmd =", cmd)
+ log.Log(WARN, "CheckDirty() b =", b)
+ log.Log(WARN, "CheckDirty() path =", path)
+ log.Log(WARN, "CheckDirty() out =", out)
+ log.Log(WARN, "CheckDirty() err =", err)
+
+ cmd = []string{"git", "diff-index", "--quiet", "HEAD"}
+ err, b, out = RunCmd(path, cmd)
+
+ log.Log(WARN, "CheckDirty() true", rs.realPath.String())
+ log.Log(WARN, "CheckDirty() cmd =", cmd)
+ log.Log(WARN, "CheckDirty() b =", b)
+ log.Log(WARN, "CheckDirty() path =", path)
+ log.Log(WARN, "CheckDirty() out =", out)
+ log.Log(WARN, "CheckDirty() err =", err)
+
+ if b {
+ log.Log(INFO, "CheckDirty() IS ACTUALLY CLEAN")
+ rs.dirtyLabel.SetValue("no")
+ return false
+ }
+
rs.dirtyLabel.SetValue("dirty")
return true