aboutsummaryrefslogtreecommitdiffstats
path: root/modules/git/repo.go
diff options
context:
space:
mode:
authorViktor Yakovchuk <viktor@yakovchuk.net>2021-06-24 00:08:26 +0300
committerGitHub <noreply@github.com>2021-06-23 17:08:26 -0400
commit08f4b3f31288bc4e12e94f00c7d88583ab04dd2e (patch)
tree79a9157a6a105493744491d2764739dccbba19a9 /modules/git/repo.go
parentf2babf334676f9c16a540153432bc6e4ebf62423 (diff)
downloadgitea-08f4b3f31288bc4e12e94f00c7d88583ab04dd2e.tar.gz
gitea-08f4b3f31288bc4e12e94f00c7d88583ab04dd2e.zip
Fix 500 Error with branch and tag sharing the same name #15592 (#16040)
* Fix 500 Error with branch and tag sharing the same name #15592 Fixed 500 error while create Pull request when there are more than one sources (branch, tag) with the same name Fix #15592 Signed-off-by: Viktor Yakovchuk <viktor@yakovchuk.net> * fix logging Co-authored-by: techknowlogick <techknowlogick@gitea.io> Co-authored-by: 6543 <6543@obermui.de>
Diffstat (limited to 'modules/git/repo.go')
-rw-r--r--modules/git/repo.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/modules/git/repo.go b/modules/git/repo.go
index e06cd43935..43f329f448 100644
--- a/modules/git/repo.go
+++ b/modules/git/repo.go
@@ -225,6 +225,13 @@ func Push(repoPath string, opts PushOptions) error {
}
err.GenerateMessage()
return err
+ } else if strings.Contains(errbuf.String(), "matches more than one") {
+ err := &ErrMoreThanOne{
+ StdOut: outbuf.String(),
+ StdErr: errbuf.String(),
+ Err: err,
+ }
+ return err
}
}