diff options
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 |
