summaryrefslogtreecommitdiff
path: root/repo.merge.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-02-13 23:39:07 -0600
committerJeff Carr <[email protected]>2025-02-13 23:39:07 -0600
commite127f53bd42684eedf0f6fa6284ac1eeeb7df561 (patch)
treef839fd045c5f4c183ebe79141d5778fff23dd399 /repo.merge.go
parent9cc9b9bc8733a02e5e9de88a7a3ffb6672aa345c (diff)
check branch differencesv0.0.75
Diffstat (limited to 'repo.merge.go')
-rw-r--r--repo.merge.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/repo.merge.go b/repo.merge.go
index 441585a..20bc5b0 100644
--- a/repo.merge.go
+++ b/repo.merge.go
@@ -55,6 +55,11 @@ 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
+ return nil, fmt.Errorf("can't merge to master on read only() repos")
+ }
if r.CheckDirty() {
return nil, fmt.Errorf("repo is dirty")
}