rm more readonly stuff finally

This commit is contained in:
Jeff Carr 2025-09-11 06:41:22 -05:00
parent c2e3108698
commit cb60421374
1 changed files with 14 additions and 12 deletions

View File

@ -50,19 +50,21 @@ func (r *Repo) MergeToMaster() (*cmd.Status, error) {
if r.GetCurrentBranchName() != r.GetMasterBranchName() {
return nil, fmt.Errorf("repo not on master branch")
}
if r.GetReadOnly() {
r.Reload() // rescan the repo
// master branch is read only. you can not git push
lh := r.GetLocalHash("devel")
rh := r.GetRemoteHash("devel")
if lh == rh {
// log.Info(r.FullPath, "local devel == remote devel", lh, rh)
} else {
log.Info(r.FullPath, "local devel != remote devel", lh, rh)
/*
if r.GetReadOnly() {
r.Reload() // rescan the repo
// master branch is read only. you can not git push
lh := r.GetLocalHash("devel")
rh := r.GetRemoteHash("devel")
if lh == rh {
// log.Info(r.FullPath, "local devel == remote devel", lh, rh)
} else {
log.Info(r.FullPath, "local devel != remote devel", lh, rh)
}
log.Info("can't merge to master on read only() repos. trying anyway")
// return nil, fmt.Errorf("can't merge to master on read only() repos")
}
log.Info("can't merge to master on read only() repos. trying anyway")
// return nil, fmt.Errorf("can't merge to master on read only() repos")
}
*/
if r.CheckDirty() {
return nil, fmt.Errorf("repo is dirty")
}