summaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'main.go')
-rw-r--r--main.go27
1 files changed, 7 insertions, 20 deletions
diff --git a/main.go b/main.go
index 26616f5..c3e9634 100644
--- a/main.go
+++ b/main.go
@@ -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 {