36 lines
639 B
Go
36 lines
639 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"go.wit.com/lib/protobuf/gitpb"
|
|
"go.wit.com/log"
|
|
)
|
|
|
|
func doClean() error {
|
|
all := me.forge.Repos.SortByFullPath()
|
|
for all.Scan() {
|
|
repo := all.Next()
|
|
if err := doCleanRepo(repo); err != nil {
|
|
badExit(err)
|
|
}
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func doCleanRepo(repo *gitpb.Repo) error {
|
|
log.Info("Cleaning:", repo.GetGoPath())
|
|
if repo.GitConfig == nil {
|
|
return fmt.Errorf("GitConfig == nil")
|
|
}
|
|
|
|
for _, l := range repo.GitConfig.Local {
|
|
log.Info("\tlocal branch name:", l.Name)
|
|
}
|
|
|
|
for name, b := range repo.GitConfig.Branches {
|
|
log.Info("\tlocal branch name:", name, b.Merge, b.Remote)
|
|
}
|
|
return nil
|
|
}
|