summaryrefslogtreecommitdiffstats
path: root/routers
diff options
context:
space:
mode:
authorKN4CK3R <admin@oldschoolhack.me>2022-08-09 15:47:57 +0200
committerGitHub <noreply@github.com>2022-08-09 16:47:57 +0300
commit920481340b3d3c384c16296be52ca187ee8b0e0b (patch)
tree682a194a04c42275fd71f7ff6251c6eaac4f520f /routers
parent1b2cd4c4e19c78390be329b4a3ad50ff8857ca8d (diff)
downloadgitea-920481340b3d3c384c16296be52ca187ee8b0e0b.tar.gz
gitea-920481340b3d3c384c16296be52ca187ee8b0e0b.zip
Keep download count on Container tag overwrite (#20728)
Co-authored-by: 6543 <6543@obermui.de>
Diffstat (limited to 'routers')
-rw-r--r--routers/api/packages/container/manifest.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/routers/api/packages/container/manifest.go b/routers/api/packages/container/manifest.go
index 319c9bcabc..8beed3dbb7 100644
--- a/routers/api/packages/container/manifest.go
+++ b/routers/api/packages/container/manifest.go
@@ -312,6 +312,9 @@ func createPackageAndVersion(ctx context.Context, mci *manifestCreationInfo, met
return nil, err
}
+ // keep download count on overwrite
+ _pv.DownloadCount = pv.DownloadCount
+
if pv, err = packages_model.GetOrInsertVersion(ctx, _pv); err != nil {
log.Error("Error inserting package: %v", err)
return nil, err