diff options
Diffstat (limited to 'doCommon.go')
| -rw-r--r-- | doCommon.go | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/doCommon.go b/doCommon.go index 296f1cb..3e94055 100644 --- a/doCommon.go +++ b/doCommon.go @@ -33,6 +33,25 @@ func doGitPull() { } } +func doGitReset() { + if !argv.DoGitReset { + return + } + all := me.found.SortByGoPath() + for all.Scan() { + repo := all.Next() + if me.forge.Config.IsReadOnly(repo.GoPath) { + // log.Info("is readonly", repo.GoPath) + if repo.CheckDirty() { + log.Info("is readonly and dirty", repo.GoPath) + cmd := []string{"git", "reset", "--hard"} + repo.RunRealtime(cmd) + } + } else { + // log.Info("is not readonly", repo.GoPath) + } + } +} func doFix() { all := me.found.SortByGoPath() |
