From b95b8bf55b6598d27a143e43d2353737e5bbc1b1 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Fri, 10 Oct 2025 05:50:11 -0500 Subject: an edge case to handle when you are on a branch that doesn't exist --- doFix.go | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) (limited to 'doFix.go') diff --git a/doFix.go b/doFix.go index f29aa04..df9b861 100644 --- a/doFix.go +++ b/doFix.go @@ -12,9 +12,10 @@ import ( // is every repo on the devel branch? func doFix() (string, error) { + var s string + var err error if argv.Fixer.Urls { - err := doFixUrls() - return "", err + err = doFixUrls() } if argv.Fixer.Untracked { return doRemoveUntrackedFiles() @@ -31,9 +32,25 @@ func doFix() (string, error) { } repo.RunVerbose([]string{"git", "fetch", "--prune"}) } - return "", nil } - return "", nil + + if argv.Fixer.Porcelain != nil { + s, err = getPorcelain() + for repo := range me.forge.Repos.IterByFullPath() { + curbranch := repo.GetCurrentBranchName() + if repo.IsLocalBranch(curbranch) { + continue + } + if repo.IsRemoteBranch(curbranch) { + continue + } + log.Info("curbranch is doesn't exist. this'll cause all sorts of problems", curbranch, repo.FullPath) + repo.CheckoutForce() + } + me.forge.Repos.Save() + } + + return s, err } func doRemoveUntrackedFiles() (string, error) { -- cgit v1.2.3