check for "normal" repo states
This commit is contained in:
parent
5b5d262ce4
commit
a21d17dda9
22
doDirty.go
22
doDirty.go
|
@ -13,6 +13,12 @@ import (
|
||||||
|
|
||||||
func doDirty() {
|
func doDirty() {
|
||||||
doCheckDirtyAndConfigSave()
|
doCheckDirtyAndConfigSave()
|
||||||
|
if allerr := me.forge.RillRepos(checkNormalRepoState); len(allerr) != 0 {
|
||||||
|
log.Info("Some repos are not in a 'normal' state. error count =", len(allerr))
|
||||||
|
for repo, err := range allerr {
|
||||||
|
log.Info("repo not normal", repo.GetFullPath(), err)
|
||||||
|
}
|
||||||
|
}
|
||||||
found := findDirty()
|
found := findDirty()
|
||||||
if argv.Verbose {
|
if argv.Verbose {
|
||||||
me.forge.PrintHumanTableDirty(found)
|
me.forge.PrintHumanTableDirty(found)
|
||||||
|
@ -21,6 +27,21 @@ func doDirty() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 99% of the time, the repos during development should be on your user branch.
|
||||||
|
// error out if it's not
|
||||||
|
// this checks to see if a devel and user branch exist
|
||||||
|
// this needs to run each time in case repos were added manually by the user
|
||||||
|
// this also verifies that
|
||||||
|
func checkNormalRepoState(repo *gitpb.Repo) error {
|
||||||
|
if err := repo.MakeLocalDevelBranch(); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if repo.GetCurrentBranchName() != repo.GetUserBranchName() {
|
||||||
|
return repo.CheckoutUser()
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
func straightCheckDirty() int {
|
func straightCheckDirty() int {
|
||||||
var count int
|
var count int
|
||||||
// var total int
|
// var total int
|
||||||
|
@ -45,6 +66,7 @@ func doCheckDirty(repo *gitpb.Repo) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// recheck every repo's dirty state according to 'git'
|
||||||
func doCheckDirtyAndConfigSave() {
|
func doCheckDirtyAndConfigSave() {
|
||||||
start := straightCheckDirty()
|
start := straightCheckDirty()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue