From f8dd6bca59bd66904eff05d1d33e117f816f46d9 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Fri, 21 Feb 2025 16:35:21 -0600 Subject: correctly cleans remote user branches finally! --- windowRepoProblems.go | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'windowRepoProblems.go') diff --git a/windowRepoProblems.go b/windowRepoProblems.go index b60125c..08e1f32 100644 --- a/windowRepoProblems.go +++ b/windowRepoProblems.go @@ -123,10 +123,21 @@ func makeRepoProblemsWindow() *repoProblemsWindow { found := remoteUserBranchProblem() group := box.NewGroup("test buttons") group.NewButton("git branch delete", func() { + win.Disable() + defer win.Enable() all := found.SortByFullPath() for all.Scan() { repo := all.Next() - log.Info("git branch -D jcarr", repo.GetGoPath()) + brname := repo.GetUserBranchName() + // git push origin --delete jcarr + cmd := []string{"git", "push", "origin", "--delete", brname} + log.Info(repo.GetGoPath(), cmd) + repo.RunVerbose(cmd) + + // git branch --delete --remote origin/jcarr + cmd = []string{"git", "branch", "--delete", "--remote", "origin/" + brname} + log.Info(repo.GetGoPath(), cmd) + repo.RunVerbose(cmd) } }) @@ -144,14 +155,14 @@ func makeRepoProblemsWindow() *repoProblemsWindow { txt = fmt.Sprintf("remote devel != local devel (%d)", found.Len()) grid.NewButton(txt, func() { found := develRemoteProblem() - makeStandardReposWindow(found) + makeStandardReposWindow(txt, found) }) found = masterRemoteProblem() txt = fmt.Sprintf("remote master != local master (%d)", found.Len()) grid.NewButton(txt, func() { found := masterRemoteProblem() - makeStandardReposWindow(found) + makeStandardReposWindow(txt, found) }) grid.NextRow() -- cgit v1.2.3