aboutsummaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorwxiaoguang <wxiaoguang@gmail.com>2024-12-07 05:10:35 +0800
committerGitHub <noreply@github.com>2024-12-06 21:10:35 +0000
commit513da407f406b161aca078c8e1158f3394e71ca1 (patch)
treedcec1cb252744c3c85cc0273e025cb7f9079a2ce /modules
parent5a75160c92190eb038d9b0fc71846310e76a5481 (diff)
downloadgitea-513da407f406b161aca078c8e1158f3394e71ca1.tar.gz
gitea-513da407f406b161aca078c8e1158f3394e71ca1.zip
Support "merge upstream branch" (Sync fork) (#32741)
Add basic "sync fork" support (GitHub-like) <details> ![image](https://github.com/user-attachments/assets/e71473f4-4518-48c7-b9e2-fedfcd564fc3) </details>
Diffstat (limited to 'modules')
-rw-r--r--modules/git/repo.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/git/repo.go b/modules/git/repo.go
index 1c223018ad..fc6e6e7acc 100644
--- a/modules/git/repo.go
+++ b/modules/git/repo.go
@@ -223,7 +223,7 @@ func Push(ctx context.Context, repoPath string, opts PushOptions) error {
if err != nil {
if strings.Contains(stderr, "non-fast-forward") {
return &ErrPushOutOfDate{StdOut: stdout, StdErr: stderr, Err: err}
- } else if strings.Contains(stderr, "! [remote rejected]") {
+ } else if strings.Contains(stderr, "! [remote rejected]") || strings.Contains(stderr, "! [rejected]") {
err := &ErrPushRejected{StdOut: stdout, StdErr: stderr, Err: err}
err.GenerateMessage()
return err