rm more old code
This commit is contained in:
parent
c4669bc348
commit
a8088938d2
12
newRepo.go
12
newRepo.go
|
@ -111,20 +111,26 @@ func (r *RepoList) AddRepo(pb *gitpb.Repo) (*RepoRow, error) {
|
||||||
})
|
})
|
||||||
|
|
||||||
newRepo.endBox.NewButton("commit all", func() {
|
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")
|
log.Log(REPOWARN, "can not commit on non user branch")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
r.reposbox.Disable()
|
r.reposbox.Disable()
|
||||||
|
|
||||||
// restore anything staged so everything can be reviewed
|
// 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 diff")
|
||||||
newRepo.Status.XtermWait("git add --all")
|
newRepo.Status.XtermWait("git add --all")
|
||||||
newRepo.Status.XtermWait("git commit -a")
|
newRepo.Status.XtermWait("git commit -a")
|
||||||
newRepo.Status.XtermWait("git push")
|
newRepo.Status.XtermWait("git push")
|
||||||
if newRepo.Status.CheckDirty() {
|
if newRepo.Status.CheckDirty() {
|
||||||
// commit was not done, restore diff
|
// commit was not done, restore diff
|
||||||
newRepo.Status.Run([]string{"git", "restore", "--staged", "."})
|
pb.RunRealtimeVerbose([]string{"git", "restore", "--staged", "."})
|
||||||
} else {
|
} else {
|
||||||
newRepo.NewScan()
|
newRepo.NewScan()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue