aboutsummaryrefslogtreecommitdiffstats
path: root/routers
diff options
context:
space:
mode:
authorKN4CK3R <admin@oldschoolhack.me>2022-08-09 17:33:45 +0200
committerGitHub <noreply@github.com>2022-08-09 17:33:45 +0200
commit113d13a02672c757addc598cc95defd7a507fb8a (patch)
treebbd3fbf2dc24dce534ab1ff7915e77adddfd7827 /routers
parent9ec1c8812ea0963edca5d421912d47026349b271 (diff)
downloadgitea-113d13a02672c757addc598cc95defd7a507fb8a.tar.gz
gitea-113d13a02672c757addc598cc95defd7a507fb8a.zip
Keep download count on Container tag overwrite (#20728) (#20735)
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