aboutsummaryrefslogtreecommitdiffstats
path: root/routers
diff options
context:
space:
mode:
authorKN4CK3R <admin@oldschoolhack.me>2022-05-06 00:02:09 +0200
committerGitHub <noreply@github.com>2022-05-05 23:02:09 +0100
commit4691e598280bbfcb1c8e494e2e74b6ece796c36c (patch)
tree77a4d29b742a5990f15605fd26c9f12470cd79f0 /routers
parent0483ee8f69ef91ac3c2a710d43abb31a461ae30a (diff)
downloadgitea-4691e598280bbfcb1c8e494e2e74b6ece796c36c.tar.gz
gitea-4691e598280bbfcb1c8e494e2e74b6ece796c36c.zip
Skip duplicated layers. (#19624)
Diffstat (limited to 'routers')
-rw-r--r--routers/api/packages/container/manifest.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/routers/api/packages/container/manifest.go b/routers/api/packages/container/manifest.go
index b327538e6f..d899ac8ee2 100644
--- a/routers/api/packages/container/manifest.go
+++ b/routers/api/packages/container/manifest.go
@@ -355,6 +355,10 @@ func createFileFromBlobReference(ctx context.Context, pv, uploadVersion *package
}
var err error
if pf, err = packages_model.TryInsertFile(ctx, pf); err != nil {
+ if err == packages_model.ErrDuplicatePackageFile {
+ // Skip this blob because the manifest contains the same filesystem layer multiple times.
+ return nil
+ }
log.Error("Error inserting package file: %v", err)
return err
}