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/"`
|
||||
Dirty bool `arg:"--dirty" help:"only use dirty git repos"`
|
||||
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"`
|
||||
}
|
||||
|
||||
|
|
|
@ -42,7 +42,7 @@ func (args) doBashAuto() {
|
|||
case "examine":
|
||||
fmt.Println("fix")
|
||||
case "list":
|
||||
fmt.Println("--all --mine --favorites --private")
|
||||
fmt.Println("--full")
|
||||
case "pull":
|
||||
fmt.Println("--force")
|
||||
case "patch":
|
||||
|
|
|
@ -5,6 +5,7 @@ package main
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"time"
|
||||
|
||||
|
@ -191,12 +192,19 @@ func rillCheckoutMaster(repo *gitpb.Repo) error {
|
|||
// never do dirty repos
|
||||
return nil
|
||||
}
|
||||
if repo.GetCurrentBranchName() == repo.GetMasterBranchName() {
|
||||
// repo is already on master
|
||||
// 'giterr' means something is very wrong with this repo
|
||||
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
|
||||
}
|
||||
if repo.GetUserVersion() == "uerr" {
|
||||
repo.CheckoutMaster()
|
||||
if repo.GetCurrentBranchName() == repo.GetMasterBranchName() {
|
||||
// repo is already on master
|
||||
return nil
|
||||
}
|
||||
if me.forge.Config.IsReadOnly(repo.GetGoPath()) {
|
||||
|
|
Loading…
Reference in New Issue