summaryrefslogtreecommitdiff
path: root/doGit.go
diff options
context:
space:
mode:
Diffstat (limited to 'doGit.go')
-rw-r--r--doGit.go20
1 files changed, 20 insertions, 0 deletions
diff --git a/doGit.go b/doGit.go
index f8335e5..333ed57 100644
--- a/doGit.go
+++ b/doGit.go
@@ -63,6 +63,26 @@ func doGit() error {
me.sh.GoodExit("")
}
+ if argv.Git.DeleteUntracked {
+ initForge()
+ for repo := range me.forge.Repos.IterAll() {
+ if !strings.HasPrefix(repo.Namespace, "go.wit.com") {
+ continue
+ }
+ files, _ := repo.GitDeleteOthers()
+ log.Info(len(files), repo.Namespace)
+ log.Info(strings.Join(files, "\n"))
+ if argv.Force {
+ if len(files) > 0 {
+ cmd := []string{"rm"}
+ cmd = append(cmd, files...)
+ _, err := fhelp.RunRealtimeError(cmd)
+ return err
+ }
+ }
+ }
+ }
+
return nil
}