gitpb.Reload() after commit

This commit is contained in:
Jeff Carr 2025-01-07 21:22:16 -06:00
parent ea35f3c0fb
commit f6e303a1d2
2 changed files with 8 additions and 7 deletions

View File

@ -88,7 +88,6 @@ func (r *RepoList) AddRepo(pb *gitpb.Repo) (*RepoRow, error) {
newRepo.hidden = false
r.allrepos[pb.GetGoPath()] = newRepo
// newRepo.NewScan()
newRepo.lastTag = r.reposgrid.NewLabel("")
newRepo.masterVersion = r.reposgrid.NewLabel("")
@ -110,6 +109,9 @@ func (r *RepoList) AddRepo(pb *gitpb.Repo) (*RepoRow, error) {
log.Log(WARN, "show diff masterVersion =", newRepo.masterVersion.String())
// newRepo.Status.XtermNohup([]string{"git diff"})
newRepo.Xterm("git diff; bash")
pb := newRepo.pb
pb.Reload()
newRepo.NewScan()
r.reposbox.Enable()
})
@ -131,12 +133,13 @@ func (r *RepoList) AddRepo(pb *gitpb.Repo) (*RepoRow, error) {
newRepo.XtermWait("git add --all")
newRepo.XtermWait("git commit -a")
newRepo.XtermWait("git push")
if newRepo.Status.CheckDirty() {
// commit was not done, restore diff
// this is paused here until the user closes the xterm window
if pb.CheckDirty() {
// commit was not actually done, restore the diff
pb.RunRealtimeVerbose([]string{"git", "restore", "--staged", "."})
} else {
newRepo.NewScan()
}
pb.Reload()
newRepo.NewScan()
r.reposbox.Enable()
})

View File

@ -56,8 +56,6 @@ func (r *RepoRow) NewScan() int {
return changed
}
pb.Reload()
if r.lastTag != nil {
r.lastTag.SetLabel(pb.GetLastTag())
}