summaryrefslogtreecommitdiff
path: root/scan.go
diff options
context:
space:
mode:
Diffstat (limited to 'scan.go')
-rw-r--r--scan.go26
1 files changed, 11 insertions, 15 deletions
diff --git a/scan.go b/scan.go
index e8c613d..0a52d95 100644
--- a/scan.go
+++ b/scan.go
@@ -63,20 +63,6 @@ func (r *repo) newScan() bool {
return false
}
-func (r *repo) getStatus() string {
- if r.status.CheckDirty() {
- log.Warn("CheckDirty() true")
- return "dirty"
- }
-
- if r.status.CheckBranches() {
- log.Warn("Branches are Perfect")
- return "PERFECT"
- }
- log.Warn("Branches are not Perfect")
- return "merge"
-}
-
func (r *repo) getGoSumStatus() string {
return r.goSumStatus.String()
}
@@ -86,10 +72,20 @@ func (r *repo) setGoSumStatus(s string) {
r.status.SetGoSumStatus(s)
}
+func (r *repo) checkDirty() bool {
+ if r.status.CheckDirty() {
+ log.Info("dirty repo:", r.status.String(), r.getGoSumStatus())
+ r.setGoSumStatus("DIRTY")
+ return true
+ }
+ return false
+}
+
func (r *repo) checkSafeGoSumRemake() {
if ok, bad := r.status.CheckSafeGoSumRemake(); ok {
log.Info("checkSafeGoSumRemake() is safe to redo")
r.setGoSumStatus("SAFE")
+ r.status.MakeRedomod()
} else {
log.Info("checkSafeGoSumRemake() is not safe. problems:", bad)
r.setGoSumStatus("BAD DEP")
@@ -110,7 +106,7 @@ func scanGoSum() {
repo.setGoSumStatus("PRIMATIVE")
continue
}
- if repo.status.CheckDirty() {
+ if repo.checkDirty() {
log.Info("dirty repo:", latestversion, repo.status.String())
log.Info("dirty repo.getGoSumStatus =", repo.getGoSumStatus())
repo.setGoSumStatus("DIRTY")