fix defective google "Git on Borg" repos
This commit is contained in:
parent
99e30376f0
commit
06cf0f7d84
1
argv.go
1
argv.go
|
@ -101,6 +101,7 @@ type FindCmd struct {
|
||||||
Private bool `arg:"--private" help:"your private repos from your .config/forge/"`
|
Private bool `arg:"--private" help:"your private repos from your .config/forge/"`
|
||||||
Dirty bool `arg:"--dirty" help:"only use dirty git repos"`
|
Dirty bool `arg:"--dirty" help:"only use dirty git repos"`
|
||||||
User bool `arg:"--user" help:"show repos on the user branch"`
|
User bool `arg:"--user" help:"show repos on the user branch"`
|
||||||
|
Full bool `arg:"--full" help:"show full repo names"`
|
||||||
// ReadOnly bool `arg:"--readonly" help:"include read-only repos"`
|
// ReadOnly bool `arg:"--readonly" help:"include read-only repos"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -42,7 +42,7 @@ func (args) doBashAuto() {
|
||||||
case "examine":
|
case "examine":
|
||||||
fmt.Println("fix")
|
fmt.Println("fix")
|
||||||
case "list":
|
case "list":
|
||||||
fmt.Println("--all --mine --favorites --private")
|
fmt.Println("--full")
|
||||||
case "pull":
|
case "pull":
|
||||||
fmt.Println("--force")
|
fmt.Println("--force")
|
||||||
case "patch":
|
case "patch":
|
||||||
|
|
|
@ -5,6 +5,7 @@ package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
@ -191,12 +192,19 @@ func rillCheckoutMaster(repo *gitpb.Repo) error {
|
||||||
// never do dirty repos
|
// never do dirty repos
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
if repo.GetCurrentBranchName() == repo.GetMasterBranchName() {
|
// 'giterr' means something is very wrong with this repo
|
||||||
// repo is already on master
|
if repo.GetMasterVersion() == "giterr" {
|
||||||
|
repo.CheckoutMaster()
|
||||||
|
log.Info("master == giterr. BAD REPO", repo.GetFullPath())
|
||||||
|
log.Info("master == giterr. BAD REPO", repo.GetFullPath())
|
||||||
|
log.Info("master == giterr. BAD REPO", repo.GetFullPath())
|
||||||
|
cmd := []string{"git", "checkout", "main"} // todo: figure out main
|
||||||
|
repo.RunVerbose(cmd)
|
||||||
|
os.Exit(-1)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
if repo.GetUserVersion() == "uerr" {
|
if repo.GetCurrentBranchName() == repo.GetMasterBranchName() {
|
||||||
repo.CheckoutMaster()
|
// repo is already on master
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
if me.forge.Config.IsReadOnly(repo.GetGoPath()) {
|
if me.forge.Config.IsReadOnly(repo.GetGoPath()) {
|
||||||
|
|
6
main.go
6
main.go
|
@ -142,7 +142,11 @@ func main() {
|
||||||
if argv.List != nil {
|
if argv.List != nil {
|
||||||
found := argv.List.findRepos()
|
found := argv.List.findRepos()
|
||||||
// print out the repos
|
// print out the repos
|
||||||
me.forge.PrintHumanTable(found)
|
if argv.List.Full {
|
||||||
|
me.forge.PrintHumanTableFull(found)
|
||||||
|
} else {
|
||||||
|
me.forge.PrintHumanTable(found)
|
||||||
|
}
|
||||||
okExit("")
|
okExit("")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue