summaryrefslogtreecommitdiff
path: root/reloadRepoState.go
diff options
context:
space:
mode:
Diffstat (limited to 'reloadRepoState.go')
-rw-r--r--reloadRepoState.go38
1 files changed, 38 insertions, 0 deletions
diff --git a/reloadRepoState.go b/reloadRepoState.go
new file mode 100644
index 0000000..322c5b0
--- /dev/null
+++ b/reloadRepoState.go
@@ -0,0 +1,38 @@
+package gitpb
+
+// does processing on the go.mod and go.sum files
+
+import (
+ "go.wit.com/log"
+)
+
+func (repo *Repo) setRepoState() {
+ if repo == nil {
+ return
+ }
+ if repo.IsDirty() {
+ repo.State = "dirty"
+ return
+ }
+ if repo.GetUserVersion() != repo.GetDevelVersion() {
+ repo.State = "merge to devel"
+ return
+ }
+ if repo.GetDevelVersion() != repo.GetMasterVersion() {
+ repo.State = "merge to main"
+ return
+ }
+ if repo.GetLastTag() != repo.GetMasterVersion() {
+ repo.State = "unchanged"
+ return
+ }
+
+ if repo.CheckBranches() {
+ repo.State = "PERFECT"
+ return
+ }
+ log.Info("Branches are not Perfect", repo.GetFullPath())
+ log.Info("Branches are not Perfect", repo.GetFullPath())
+ log.Info("Branches are not Perfect", repo.GetFullPath())
+ repo.State = "unknown branches"
+}