diff options
author | 6543 <6543@obermui.de> | 2020-04-01 17:51:06 +0200 |
---|---|---|
committer | TBK <tbk@jjtc.eu> | 2020-04-03 08:23:46 +0000 |
commit | 434613487a5c8bf85951a145527afc112131e111 (patch) | |
tree | a6993ec4b31740490f021373257dacfedf7d69d5 | |
parent | 3044da9e392e45b980b3251997554a4cdced1b89 (diff) | |
download | aports-434613487a5c8bf85951a145527afc112131e111.tar.bz2 aports-434613487a5c8bf85951a145527afc112131e111.tar.xz |
community/gitea: upgrade to 1.11.4
-rw-r--r-- | community/gitea/0001-Fix-rebase-conflict-detection-in-git-2.26.patch | 62 | ||||
-rw-r--r-- | community/gitea/APKBUILD | 6 |
2 files changed, 66 insertions, 2 deletions
diff --git a/community/gitea/0001-Fix-rebase-conflict-detection-in-git-2.26.patch b/community/gitea/0001-Fix-rebase-conflict-detection-in-git-2.26.patch new file mode 100644 index 0000000000..9c43adab68 --- /dev/null +++ b/community/gitea/0001-Fix-rebase-conflict-detection-in-git-2.26.patch @@ -0,0 +1,62 @@ +From d90735d2e8ddfe02794a772ae07666aa4ebc105e Mon Sep 17 00:00:00 2001 +From: 6543 <6543@obermui.de> +Date: Thu, 2 Apr 2020 22:46:50 +0200 +Subject: [PATCH] Fix rebase conflict detection in git 2.26 + +Git changed the technique used in rebase from +simple apply-patches to use merge. This breaks +our conflict detection code. + +created by: Andrew Thornton <art27@cantab.net> +--- + services/pull/merge.go | 29 +++++++++++++++++++++++------ + 1 file changed, 23 insertions(+), 6 deletions(-) + +diff --git a/services/pull/merge.go b/services/pull/merge.go +index f9d9a27c9..b71784f00 100644 +--- a/services/pull/merge.go ++++ b/services/pull/merge.go +@@ -211,17 +211,34 @@ func Merge(pr *models.PullRequest, doer *models.User, baseGitRepo *git.Repositor + if err := git.NewCommand("rebase", baseBranch).RunInDirPipeline(tmpBasePath, &outbuf, &errbuf); err != nil { + // Rebase will leave a REBASE_HEAD file in .git if there is a conflict + if _, statErr := os.Stat(filepath.Join(tmpBasePath, ".git", "REBASE_HEAD")); statErr == nil { +- // The original commit SHA1 that is failing will be in .git/rebase-apply/original-commit +- commitShaBytes, readErr := ioutil.ReadFile(filepath.Join(tmpBasePath, ".git", "rebase-apply", "original-commit")) +- if readErr != nil { +- // Abandon this attempt to handle the error ++ var commitSha string ++ ok := false ++ failingCommitPaths := []string{ ++ filepath.Join(tmpBasePath, ".git", "rebase-apply", "original-commit"), // Git < 2.26 ++ filepath.Join(tmpBasePath, ".git", "rebase-merge", "stopped-sha"), // Git >= 2.26 ++ } ++ for _, failingCommitPath := range failingCommitPaths { ++ if _, statErr := os.Stat(filepath.Join(failingCommitPath)); statErr == nil { ++ commitShaBytes, readErr := ioutil.ReadFile(filepath.Join(failingCommitPath)) ++ if readErr != nil { ++ // Abandon this attempt to handle the error ++ log.Error("git rebase staging on to base [%s:%s -> %s:%s]: %v\n%s\n%s", pr.HeadRepo.FullName(), pr.HeadBranch, pr.BaseRepo.FullName(), pr.BaseBranch, err, outbuf.String(), errbuf.String()) ++ return fmt.Errorf("git rebase staging on to base [%s:%s -> %s:%s]: %v\n%s\n%s", pr.HeadRepo.FullName(), pr.HeadBranch, pr.BaseRepo.FullName(), pr.BaseBranch, err, outbuf.String(), errbuf.String()) ++ } ++ commitSha = strings.TrimSpace(string(commitShaBytes)) ++ ok = true ++ break ++ } ++ } ++ if !ok { ++ log.Error("Unable to determine failing commit sha for this rebase message. Cannot cast as models.ErrRebaseConflicts.") + log.Error("git rebase staging on to base [%s:%s -> %s:%s]: %v\n%s\n%s", pr.HeadRepo.FullName(), pr.HeadBranch, pr.BaseRepo.FullName(), pr.BaseBranch, err, outbuf.String(), errbuf.String()) + return fmt.Errorf("git rebase staging on to base [%s:%s -> %s:%s]: %v\n%s\n%s", pr.HeadRepo.FullName(), pr.HeadBranch, pr.BaseRepo.FullName(), pr.BaseBranch, err, outbuf.String(), errbuf.String()) + } +- log.Debug("RebaseConflict at %s [%s:%s -> %s:%s]: %v\n%s\n%s", strings.TrimSpace(string(commitShaBytes)), pr.HeadRepo.FullName(), pr.HeadBranch, pr.BaseRepo.FullName(), pr.BaseBranch, err, outbuf.String(), errbuf.String()) ++ log.Debug("RebaseConflict at %s [%s:%s -> %s:%s]: %v\n%s\n%s", commitSha, pr.HeadRepo.FullName(), pr.HeadBranch, pr.BaseRepo.FullName(), pr.BaseBranch, err, outbuf.String(), errbuf.String()) + return models.ErrRebaseConflicts{ + Style: mergeStyle, +- CommitSHA: strings.TrimSpace(string(commitShaBytes)), ++ CommitSHA: commitSha, + StdOut: outbuf.String(), + StdErr: errbuf.String(), + Err: err, +-- +2.26.0 + diff --git a/community/gitea/APKBUILD b/community/gitea/APKBUILD index abb3a19e05..dc5341fbc9 100644 --- a/community/gitea/APKBUILD +++ b/community/gitea/APKBUILD @@ -2,7 +2,7 @@ # Contributor: 6543 <6543@obermui.de> # Maintainer: Carlo Landmeter <clandmeter@gmail.com> pkgname=gitea -pkgver=1.11.3 +pkgver=1.11.4 pkgrel=0 pkgdesc="A self-hosted Git service written in Go" url="https://gitea.io" @@ -19,6 +19,7 @@ subpackages="$pkgname-openrc" source="$pkgname-$pkgver.tar.gz::https://github.com/go-gitea/gitea/archive/v$pkgver.tar.gz $pkgname.initd $pkgname.ini + 0001-Fix-rebase-conflict-detection-in-git-2.26.patch " builddir="$srcdir/src/code.gitea.io/$pkgname" @@ -78,6 +79,7 @@ package() { "$pkgdir"/etc/init.d/$pkgname } -sha512sums="41ca69de38158cfebcd9c54a74c9a9068c34457c77a61e252f5287d88f2744c08d1948d95abaa575332483d069794a0e39ca0b181462e5bf47eec572feb47b9e gitea-1.11.3.tar.gz +sha512sums="5b7d07fd02f3acf900f1a3d2d9bb99a94487eaaf148d11a9746b309ee97ffc2d208fd47cc7e121ac0b2a6e97c919ea0232898f7f6851248a8407c706edbc904a gitea-1.11.4.tar.gz +4c2c4933c482f0c06447252b50533d637cbd0ad7416684c0771ad7e3326d9793b5f28879f5251b38c51bc71ed15a4aa767ce05d08edb6ca0840749e659fb5081 0001-Fix-rebase-conflict-detection-in-git-2.26.patch 2497e6f2a18e3ceb65352cd220eab2c1c0893d0e731600462a60397de2b70d7c1de7db2af2769b25fe708b0822c811bb20dc797b59b9dd93efb376bea1c35796 gitea.initd 0fd40db2ec9150b354448f1fa6c8cd2515911619935afb55f070a1a9f594badce2cd46b436b930464495f6561f97c999de2489710761e3f829832b8e4da5eb23 gitea.ini" |