summaryrefslogtreecommitdiff
path: root/git.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-02-14 02:35:47 -0600
committerJeff Carr <[email protected]>2024-02-14 02:35:47 -0600
commit73d711ad2b2ebb311fadf9ab3739589df890993a (patch)
tree1febfc8449a863920b536e79d7e33e1d35d8150a /git.go
parentd7e391fed0843aa56ead128737c2770704846bac (diff)
trying to improve older code
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'git.go')
-rw-r--r--git.go20
1 files changed, 16 insertions, 4 deletions
diff --git a/git.go b/git.go
index 7580062..a8bed77 100644
--- a/git.go
+++ b/git.go
@@ -332,6 +332,14 @@ func (rs *RepoStatus) GetStatus() string {
}
// TODO: make this report the error somewhere
+// This is supposed to check all the branches to make sure
+// the are the same. that was originally what this was for
+// now I think it's jsut probably dumb old code that doesn't
+// need to be here
+
+// actually, this is to attempt to verify absolutely everything
+// is pushed upstream before doing a rm -rf ~/go/src
+// TODO: revisit this code in the autotypist later
func (rs *RepoStatus) CheckBranches() bool {
var hashCheck string
var perfect bool = true
@@ -363,17 +371,21 @@ func (rs *RepoStatus) CheckBranches() bool {
}
var cmd []string
cmd = append(cmd, "git", "show", "-s", "--format=%ci", hash)
- _, _, output := RunCmd(rs.realPath.String(), cmd)
+ err, output := rs.RunCmd(cmd)
+ if err != nil {
+ // log.Log(WARN, "cmd failed", cmd, "err =", err, "in", rs.String())
+ }
// git show -s --format=%ci <hash> will give you the time
// log.Log(INFO, fullfile)
if hash == hashCheck {
log.Log(INFO, hash, output, b)
} else {
- log.Warn("UNKNOWN BRANCHES IN THIS REPO")
+ // log.Log(WARN, rs.String(), hash, output, b)
+ // log.Log(WARN, "UNKNOWN BRANCHES IN THIS REPO", cmd)
rs.versionCmdOutput.SetText("UNKNOWN BRANCHES")
perfect = false
- parts := strings.Split(b, "/")
- log.Warn("git push", parts)
+ // parts := strings.Split(b, "/")
+ // log.Warn("git push", parts)
}
}
return perfect