summaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-12-13 17:13:29 -0600
committerJeff Carr <[email protected]>2024-12-13 17:13:29 -0600
commit3a83cf030d6037790f1a57bb224f6bf55054a120 (patch)
treedd3e3d570df936caaa6d47b37571b034809101a6 /main.go
parent8c68cff7624dd797533122509a7d86ed316090c5 (diff)
start skipping repos with tracked go.* files
Diffstat (limited to 'main.go')
-rw-r--r--main.go22
1 files changed, 22 insertions, 0 deletions
diff --git a/main.go b/main.go
index 8febccd..fb50fa0 100644
--- a/main.go
+++ b/main.go
@@ -131,6 +131,28 @@ func doMain(repo *gitpb.Repo) error {
return errors.New(repo.GoPath + " not in the git master branch")
}
+ ok, err := repoOwnsGoMod(repo)
+ if err != nil {
+ return err
+ }
+ // if ok, then git owns 'go.mod' and we can't really do anything
+ // todo: ignore this with --force
+ if ok {
+ return nil
+ } else {
+ if forge.Config.IsReadOnly(repo.GoPath) {
+ log.Info("skipping read only", repo.GoPath)
+ return nil
+ }
+ }
+
+ if repo.CheckDirty() {
+ log.Info("")
+ log.Info("You can not run this on dirty branches.")
+ log.Info("")
+ return errors.New(repo.GoPath + " git repo is dirty")
+ }
+
// re-create go.sum and go.mod
if err := redoGoMod(repo); err != nil {
return err