gitpb code is changing

This commit is contained in:
Jeff Carr 2025-02-21 09:33:58 -06:00
parent fa5c6572ff
commit 3ab156a9c4
1 changed files with 38 additions and 36 deletions

View File

@ -81,45 +81,47 @@ func MakeRepoBranchesWindow(repo *gitpb.Repo) *repoBranchesWindow {
grid.NewGroup("Hash")
grid.NextRow()
for _, b := range repo.GetLocalBranches() {
hash := repo.GetBranchHash(b)
grid.NewLabel(b)
grid.NewLabel(repo.GetBranchVersion(b))
if s, err := repo.GetHashName(hash); err == nil {
grid.NewLabel(s)
} else {
grid.NewLabel("err")
}
grid.NewLabel("local")
/*
for _, b := range repo.GetLocalBranches() {
hash := repo.GetBranchHash(b)
grid.NewLabel(b)
grid.NewLabel(repo.GetBranchVersion(b))
if s, err := repo.GetHashName(hash); err == nil {
grid.NewLabel(s)
} else {
grid.NewLabel("err")
}
grid.NewLabel("local")
grid.NewLabel(hash)
grid.NewButton("Delete", func() {
repo.RunVerbose([]string{"git", "branch", "-D", b})
})
grid.NextRow()
}
for _, b := range repo.GetRemoteBranches() {
hash := repo.GetBranchHash(b)
grid.NewLabel(b)
forgeuse := repo.GetBranchVersion(b)
grid.NewLabel(forgeuse)
if s, err := repo.GetHashName(hash); err == nil {
grid.NewLabel(s)
} else {
grid.NewLabel("")
}
grid.NewLabel("remote")
grid.NewLabel(hash)
if b == "origin/HEAD" || forgeuse == "remote master" {
// can't delete these
} else {
grid.NewButton("Delete Remote", func() {
grid.NewLabel(hash)
grid.NewButton("Delete", func() {
repo.RunVerbose([]string{"git", "branch", "-D", b})
})
grid.NextRow()
}
grid.NextRow()
}
for _, b := range repo.GetRemoteBranches() {
hash := repo.GetBranchHash(b)
grid.NewLabel(b)
forgeuse := repo.GetBranchVersion(b)
grid.NewLabel(forgeuse)
if s, err := repo.GetHashName(hash); err == nil {
grid.NewLabel(s)
} else {
grid.NewLabel("")
}
grid.NewLabel("remote")
grid.NewLabel(hash)
if b == "origin/HEAD" || forgeuse == "remote master" {
// can't delete these
} else {
grid.NewButton("Delete Remote", func() {
})
}
grid.NextRow()
}
*/
return pw
}