]> source.dussan.org Git - gitea.git/commit
Refactor and tidy-up the merge/update branch code (#22568)
authorzeripath <art27@cantab.net>
Tue, 7 Mar 2023 20:07:35 +0000 (20:07 +0000)
committerGitHub <noreply@github.com>
Tue, 7 Mar 2023 20:07:35 +0000 (15:07 -0500)
commit8598356df1eb21b6e33ecb9f9268ba36c5488e7c
tree6236ba7c65f06a85a1a20641f4338d4b315cda4b
parenta2f44463f07cc184b0d6ca1655d1f26d75491896
Refactor and tidy-up the merge/update branch code (#22568)

The merge and update branch code was previously a little tangled and had
some very long functions. The functions were not very clear in their
reasoning and there were deficiencies in their logging and at least one
bug in the handling of LFS for update by rebase.

This PR substantially refactors this code and splits things out to into
separate functions. It also attempts to tidy up the calls by wrapping
things in "context"s. There are also attempts to improve logging when
there are errors.

Signed-off-by: Andrew Thornton <art27@cantab.net>
---------

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: delvh <dev.lh@web.de>
12 files changed:
modules/git/pipeline/revlist.go
services/pull/lfs.go
services/pull/merge.go
services/pull/merge_merge.go [new file with mode: 0644]
services/pull/merge_prepare.go [new file with mode: 0644]
services/pull/merge_rebase.go [new file with mode: 0644]
services/pull/merge_squash.go [new file with mode: 0644]
services/pull/patch.go
services/pull/pull.go
services/pull/temp_repo.go
services/pull/update.go
services/pull/update_rebase.go [new file with mode: 0644]