rm more old code

This commit is contained in:
Jeff Carr 2025-01-07 18:45:00 -06:00
parent c4669bc348
commit a8088938d2
1 changed files with 9 additions and 3 deletions

View File

@ -111,20 +111,26 @@ func (r *RepoList) AddRepo(pb *gitpb.Repo) (*RepoRow, error) {
})
newRepo.endBox.NewButton("commit all", func() {
if !newRepo.pb.IsUserBranch() {
pb := newRepo.pb
if pb == nil {
log.Info("the protobuf is nil. something went wrong in the forge/gitpb mappings")
return
}
if !pb.IsUserBranch() {
log.Log(REPOWARN, "can not commit on non user branch")
return
}
r.reposbox.Disable()
// restore anything staged so everything can be reviewed
newRepo.Status.Run([]string{"git", "restore", "--staged", "."})
pb.RunRealtimeVerbose([]string{"git", "restore", "--staged", "."})
newRepo.Status.XtermWait("git diff")
newRepo.Status.XtermWait("git add --all")
newRepo.Status.XtermWait("git commit -a")
newRepo.Status.XtermWait("git push")
if newRepo.Status.CheckDirty() {
// commit was not done, restore diff
newRepo.Status.Run([]string{"git", "restore", "--staged", "."})
pb.RunRealtimeVerbose([]string{"git", "restore", "--staged", "."})
} else {
newRepo.NewScan()
}