summaryrefslogtreecommitdiffstats
path: root/routers/api
diff options
context:
space:
mode:
authorzeripath <art27@cantab.net>2019-06-22 18:35:34 +0100
committerGitHub <noreply@github.com>2019-06-22 18:35:34 +0100
commitbaefea311f1a66a97f9a2779ad3342f4f8167d28 (patch)
treed294d768fe141af768c7f40de6f06eb6edddfeef /routers/api
parentd14595514e35810fbcf1dc0d7e3ba8ada4f08c07 (diff)
downloadgitea-baefea311f1a66a97f9a2779ad3342f4f8167d28.tar.gz
gitea-baefea311f1a66a97f9a2779ad3342f4f8167d28.zip
Fix #732: Add LFS objects to base repository on merging (#7082)
On merge we walk the merge history and ensure that all lfs objects pointed to in the history are added to the base repository. This switches from relying on having git-lfs installed on the server, (and in fact .gitattributes being correctly installed.)
Diffstat (limited to 'routers/api')
-rw-r--r--routers/api/v1/repo/pull.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/routers/api/v1/repo/pull.go b/routers/api/v1/repo/pull.go
index b14b0b02b8..d99c9a00c9 100644
--- a/routers/api/v1/repo/pull.go
+++ b/routers/api/v1/repo/pull.go
@@ -15,6 +15,7 @@ import (
"code.gitea.io/gitea/modules/git"
"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/notification"
+ "code.gitea.io/gitea/modules/pull"
api "code.gitea.io/gitea/modules/structs"
"code.gitea.io/gitea/modules/util"
)
@@ -595,7 +596,7 @@ func MergePullRequest(ctx *context.APIContext, form auth.MergePullRequestForm) {
message += "\n\n" + form.MergeMessageField
}
- if err := pr.Merge(ctx.User, ctx.Repo.GitRepo, models.MergeStyle(form.Do), message); err != nil {
+ if err := pull.Merge(pr, ctx.User, ctx.Repo.GitRepo, models.MergeStyle(form.Do), message); err != nil {
if models.IsErrInvalidMergeStyle(err) {
ctx.Status(405)
return