summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-12-18 23:06:27 -0600
committerJeff Carr <[email protected]>2024-12-18 23:06:27 -0600
commit328fbe9fdd619d0e3cb44d8529e95eb73c65692f (patch)
tree2e8d6f742ee34c1e905cbe58d0dc857fed68c94a
parent9935f45bd4c61e78f1a91d8480da520f2ee5a189 (diff)
rm duplicate codev0.0.40
-rw-r--r--goDep.redoGoMod.go46
-rw-r--r--mtime.go3
2 files changed, 11 insertions, 38 deletions
diff --git a/goDep.redoGoMod.go b/goDep.redoGoMod.go
index ee9e669..908e088 100644
--- a/goDep.redoGoMod.go
+++ b/goDep.redoGoMod.go
@@ -1,52 +1,22 @@
package gitpb
-// does processing on the go.mod and go.sum files
-
import (
- "errors"
+ "fmt"
+
+ "go.wit.com/log"
)
+// does processing on the go.mod and go.sum files
+
// checks to see if the go.sum and go.mod files exist
// also check for a match with the repo.pb GoPrimitive bool
// todo: check mtime
func (repo *Repo) ValidGoSum() error {
- if !repo.Exists("go.mod") {
- return errors.New("ValidGoSum() go.mod is missing")
- }
- if repo.GoInfo.GoPrimitive {
- if !repo.Exists("go.mod") {
- return errors.New("GoPrimitive == true, but go.mod is missing")
- }
- // repo thinks it is primitive but has a go.sum file
- if repo.Exists("go.sum") {
- return errors.New("GoPrimitive == true, but go.sum exists")
- }
- /*
- // todo: fix this
- mtime, err := repo.Mtime("go.mod")
- if err == nil {
- return err
- }
- if mtime != repo.LastGoDep.AsTime() {
- return errors.New("go.mod mtime mis-match")
- }
- */
+ if repo.ParseGoSum() {
return nil
}
- if !repo.Exists("go.sum") {
- return errors.New("ValidGoSum() go.sum is missing")
- }
- /*
- mtime, err := repo.Mtime("go.sum")
- // todo: fix this
- if err == nil {
- return err
- }
- if mtime != repo.LastGoDep.AsTime() {
- return errors.New("go.sum mtime mis-match")
- }
- */
- return nil
+ log.Info("ValidGoSum() deprecated")
+ return fmt.Errorf("ParseGoSum() failed")
}
func (repo *Repo) GoDepsLen() int {
diff --git a/mtime.go b/mtime.go
index dd13a38..8ab07b8 100644
--- a/mtime.go
+++ b/mtime.go
@@ -162,6 +162,9 @@ func (repo *Repo) updateMtimes() bool {
}
func (repo *Repo) DidRepoChange() bool {
+ if repo.Times == nil {
+ repo.Times = new(GitTimes)
+ }
if repo.didFileChange(".git/HEAD", repo.Times.MtimeHead) {
return true
}