diff options
author | Kyle Evans <kevans@FreeBSD.org> | 2020-05-11 16:52:28 +0000 |
---|---|---|
committer | Kyle Evans <kevans@FreeBSD.org> | 2020-05-11 16:52:28 +0000 |
commit | ceecbb4c57b4013373011258407ba7880214754d (patch) | |
tree | b35c9333137ecbf39391ecdc4a7a0636ceb9146a /www/gitea | |
parent | 8f7615b355d04bcb047c787fc53a1d870737b9a0 (diff) |
Notes
Diffstat (limited to 'www/gitea')
-rw-r--r-- | www/gitea/Makefile | 1 | ||||
-rw-r--r-- | www/gitea/files/patch-vendor_github.com_go-git_go-git_v5_storage_filesystem_dotgit_dotgit.go | 38 |
2 files changed, 39 insertions, 0 deletions
diff --git a/www/gitea/Makefile b/www/gitea/Makefile index 72143293afd0..f81edc273fa0 100644 --- a/www/gitea/Makefile +++ b/www/gitea/Makefile @@ -3,6 +3,7 @@ PORTNAME= gitea DISTVERSIONPREFIX= v DISTVERSION= 1.11.5 +PORTREVISION= 1 CATEGORIES= www MASTER_SITES= https://github.com/go-gitea/gitea/releases/download/${DISTVERSIONPREFIX}${DISTVERSION}/ DISTNAME= gitea-src-${DISTVERSION} diff --git a/www/gitea/files/patch-vendor_github.com_go-git_go-git_v5_storage_filesystem_dotgit_dotgit.go b/www/gitea/files/patch-vendor_github.com_go-git_go-git_v5_storage_filesystem_dotgit_dotgit.go new file mode 100644 index 000000000000..3495216f5738 --- /dev/null +++ b/www/gitea/files/patch-vendor_github.com_go-git_go-git_v5_storage_filesystem_dotgit_dotgit.go @@ -0,0 +1,38 @@ +# This patch fixes a bug where attempting to view branches with a / in the name +# would return an HTTP 500 Internal Server Error. The underlying issue ended up +# being that go-git implicitly relied on read() of a dirfd to succeed, so for a +# branch named "stable/11" it would stop and assume "stable" was the ref, but it +# was really just a directory. + +# This patch was accepted upstream here: +# https://github.com/go-git/go-git/pull/39 +# go-gitea is expected to merge it when go-git creates a new release for them to +# import, and this patch can silently go away as soon as it conflicts. + +--- vendor/github.com/go-git/go-git/v5/storage/filesystem/dotgit/dotgit.go.orig 2020-04-01 17:02:04 UTC ++++ vendor/github.com/go-git/go-git/v5/storage/filesystem/dotgit/dotgit.go +@@ -57,6 +57,9 @@ var ( + // targeting a non-existing object. This usually means the repository + // is corrupt. + ErrSymRefTargetNotFound = errors.New("symbolic reference target not found") ++ // ErrIsDir is returned when a reference file is attempting to be read, ++ // but the path specified is a directory. ++ ErrIsDir = errors.New("reference path is a directory") + ) + + // Options holds configuration for the storage. +@@ -926,6 +929,14 @@ func (d *DotGit) addRefFromHEAD(refs *[]*plumbing.Refe + + func (d *DotGit) readReferenceFile(path, name string) (ref *plumbing.Reference, err error) { + path = d.fs.Join(path, d.fs.Join(strings.Split(name, "/")...)) ++ st, err := d.fs.Stat(path) ++ if err != nil { ++ return nil, err ++ } ++ if st.IsDir() { ++ return nil, ErrIsDir ++ } ++ + f, err := d.fs.Open(path) + if err != nil { + return nil, err |