diff --git a/newRepo.go b/newRepo.go index 5933f11..7f0a953 100644 --- a/newRepo.go +++ b/newRepo.go @@ -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() }