attempt at merge to master

This commit is contained in:
Jeff Carr 2025-01-30 11:58:27 -06:00
parent 32a5530129
commit a07ad8bae8
1 changed files with 11 additions and 3 deletions

View File

@ -32,6 +32,11 @@ func (r *Repo) MergeToDevel() (*cmd.Status, error) {
// devel branch is not remote. do not try 'git push'
return result, nil
}
if r.GetReadOnly() {
r.Reload() // rescan the repo
// devel branch is read only. you can not git push
return result, nil
}
// it seems like we have write access. lets find out!
cmd = []string{"git", "push"}
@ -46,9 +51,6 @@ func (r *Repo) MergeToDevel() (*cmd.Status, error) {
func (r *Repo) MergeToMaster() (*cmd.Status, error) {
r.Reload()
ro := r.GetReadOnly()
log.Info("ro is", ro, "for", r.GetGoPath())
return nil, nil
if r.GetCurrentBranchName() != r.GetMasterBranchName() {
return nil, fmt.Errorf("repo not on master branch")
@ -68,6 +70,12 @@ func (r *Repo) MergeToMaster() (*cmd.Status, error) {
return result, err
}
if r.GetReadOnly() {
r.Reload() // rescan the repo
// master branch is read only. you can not git push
return result, nil
}
// it seems like we have write access. lets find out!
cmd = []string{"git", "push"}
result, err = r.RunQuiet(cmd)