diff options
| author | Jeff Carr <[email protected]> | 2024-12-15 15:51:53 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-12-15 15:51:53 -0600 |
| commit | 6392687a6381ce8544b3e50d4083e1391e273849 (patch) | |
| tree | 77883aab4e156c2f58bd2a343ad5453ef753555f /main.go | |
| parent | 8018774c1018467fcc7f5a45532d7068ac5634a8 (diff) | |
Diffstat (limited to 'main.go')
| -rw-r--r-- | main.go | 27 |
1 files changed, 7 insertions, 20 deletions
@@ -145,6 +145,13 @@ func doMain(repo *gitpb.Repo) error { repo.Run([]string{"git", "notes", "remove"}) } + if err := repo.RepoIgnoresGoMod(); err != nil { + log.Info("never modify go.mod or go.sum for this repo", repo.GoPath) + log.Info("We recommend you add 'go.*' to your .gitignore file and store those files as git tag metadata") + repo.ParseGoSum() + return nil + } + // erase the go.mod and go.sum files eraseGoMod(repo) @@ -184,26 +191,6 @@ func doMain(repo *gitpb.Repo) error { } } - ok, err := repoIgnoresGoMod(repo) - if err != nil { - log.Info(repo.GoPath, "some wierd git error happened. investigate.", err) - return err - } - // if ok, then git owns 'go.mod' and we can't really do anything - // todo: ignore this with --force - if ok { - log.Info(repo.GoPath, "git says it does not own go.mod") - // continue and attempt to create go.mod and go.sum - } else { - if forge.Config.IsReadOnly(repo.GoPath) { - log.Info("you can not push to read only repositories.", repo.GoPath) - log.Info("change your .config/forge/ to indicate you own this repository") - return nil - } - perfect = false - // continue and attempt to create go.mod and go.sum - } - if repo.CheckDirty() { perfect = false if argv.Strict { |
