From f575e95e8fec5c8b43396388c295de5b89b96ed0 Mon Sep 17 00:00:00 2001
From: Jeff Carr <jcarr@wit.com>
Date: Sat, 14 Dec 2024 20:35:00 -0600
Subject: [PATCH] fixes to --force and --strict

---
 main.go | 29 ++++++++++++++---------------
 1 file changed, 14 insertions(+), 15 deletions(-)

diff --git a/main.go b/main.go
index 61bf9b2..f2d2901 100644
--- a/main.go
+++ b/main.go
@@ -101,24 +101,23 @@ func doMain(repo *gitpb.Repo) error {
 		log.Info("go install go.wit.com/apps/forge@latest")
 		log.Info("")
 		return errors.New(repo.GoPath + " is invalid. fix your repository list with 'forge' first")
-	} else {
-		log.Info(repo.GoPath, "is valid according to forge")
 	}
+	log.Info(repo.GoPath, "is valid according to forge")
 
 	// skip restore if --force
-	if !argv.Force {
-		// erase the go.mod and go.sum files
-		eraseGoMod(repo)
-		cname := repo.GetCurrentBranchName()
-		// try to restore from the git metadata
-		if err := repo.AutogenRestore(cname); err != nil {
-			// ignore errors here
-		}
-		if err := repo.ValidGoSum(); err == nil {
-			log.Info(repo.GoPath, "go.mod and go.sum were restored ok")
-			configSave = true
-			return nil
-		}
+	if argv.Force {
+		repo.Run([]string{"git", "notes", "remove"})
+	}
+	// erase the go.mod and go.sum files
+	cname := repo.GetCurrentBranchName()
+	// try to restore from the git metadata
+	if err := repo.AutogenRestore(cname); err != nil {
+		// ignore errors here
+	}
+	if err := repo.ValidGoSum(); err == nil {
+		log.Info(repo.GoPath, "go.mod and go.sum were restored ok")
+		configSave = true
+		return nil
 	}
 
 	// double check here. use --force to remake them