aboutsummaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorKN4CK3R <admin@oldschoolhack.me>2022-12-10 01:11:46 +0100
committerGitHub <noreply@github.com>2022-12-10 02:11:46 +0200
commitb54c064f89725b803bcc2a2017eec6895ad07175 (patch)
treeb192e674dfdd9e0eccdd11273c608335c936ce82 /modules
parentc0ca9c612b70c14f41d6d9a0f915ece899bd0188 (diff)
downloadgitea-b54c064f89725b803bcc2a2017eec6895ad07175.tar.gz
gitea-b54c064f89725b803bcc2a2017eec6895ad07175.zip
Workaround for container registry push/pull errors (#21862) (#22068)
Backport of #21862 Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Diffstat (limited to 'modules')
-rw-r--r--modules/packages/content_store.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/modules/packages/content_store.go b/modules/packages/content_store.go
index a3a5d1a666..b0e653a102 100644
--- a/modules/packages/content_store.go
+++ b/modules/packages/content_store.go
@@ -30,6 +30,13 @@ func (s *ContentStore) Get(key BlobHash256Key) (storage.Object, error) {
return s.store.Open(KeyToRelativePath(key))
}
+// FIXME: Workaround to be removed in v1.20
+// https://github.com/go-gitea/gitea/issues/19586
+func (s *ContentStore) Has(key BlobHash256Key) error {
+ _, err := s.store.Stat(KeyToRelativePath(key))
+ return err
+}
+
// Save stores a package blob
func (s *ContentStore) Save(key BlobHash256Key, r io.Reader, size int64) error {
_, err := s.store.Save(KeyToRelativePath(key), r, size)