diff options
| author | Jeff Carr <[email protected]> | 2024-12-13 17:13:29 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-12-13 17:13:29 -0600 |
| commit | 3a83cf030d6037790f1a57bb224f6bf55054a120 (patch) | |
| tree | dd3e3d570df936caaa6d47b37571b034809101a6 /main.go | |
| parent | 8c68cff7624dd797533122509a7d86ed316090c5 (diff) | |
start skipping repos with tracked go.* files
Diffstat (limited to 'main.go')
| -rw-r--r-- | main.go | 22 |
1 files changed, 22 insertions, 0 deletions
@@ -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 |
