From 7a474d1c95cd435c574d9e92f898ed8045384995 Mon Sep 17 00:00:00 2001 From: h7x4 Date: Fri, 12 Sep 2025 16:11:24 +0200 Subject: [PATCH] Don't store repo archives on `gitea dump` (#35467) When running `gitea dump`, don't store the contents of `data/repo-archive` in the output. These archives can easily be regenerated from the repository data, and does not need to be backed up. Fixes #35450 --- Added a `--skip-repo-archive` flag to the `gitea dump` command. Enabling this flag will exclude the contents of `data/repo-archive` from the dump. The implementation is similar to the other `--skip-*` flags that excludes directories from `data`. Signed-off-by: h7x4 Co-authored-by: Lunny Xiao --- cmd/dump.go | 1 + 1 file changed, 1 insertion(+) diff --git a/cmd/dump.go b/cmd/dump.go index fa135079c0..7f0b23ed98 100644 --- a/cmd/dump.go +++ b/cmd/dump.go @@ -265,6 +265,7 @@ func runDump(ctx context.Context, cmd *cli.Command) error { excludes = append(excludes, setting.LFS.Storage.Path) excludes = append(excludes, setting.Attachment.Storage.Path) excludes = append(excludes, setting.Packages.Storage.Path) + excludes = append(excludes, setting.RepoArchive.Storage.Path) excludes = append(excludes, setting.Log.RootPath) if err := dumper.AddRecursiveExclude("data", setting.AppDataPath, excludes); err != nil { fatal("Failed to include data directory: %v", err)