1
1
mirror of https://github.com/go-gitea/gitea synced 2025-09-13 12:18:13 +00:00

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

---

<s>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`.</s>

Signed-off-by: h7x4 <h7x4@nani.wtf>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
This commit is contained in:
h7x4
2025-09-12 16:11:24 +02:00
committed by GitHub
parent 84812e42df
commit 7a474d1c95

View File

@@ -265,6 +265,7 @@ func runDump(ctx context.Context, cmd *cli.Command) error {
excludes = append(excludes, setting.LFS.Storage.Path) excludes = append(excludes, setting.LFS.Storage.Path)
excludes = append(excludes, setting.Attachment.Storage.Path) excludes = append(excludes, setting.Attachment.Storage.Path)
excludes = append(excludes, setting.Packages.Storage.Path) excludes = append(excludes, setting.Packages.Storage.Path)
excludes = append(excludes, setting.RepoArchive.Storage.Path)
excludes = append(excludes, setting.Log.RootPath) excludes = append(excludes, setting.Log.RootPath)
if err := dumper.AddRecursiveExclude("data", setting.AppDataPath, excludes); err != nil { if err := dumper.AddRecursiveExclude("data", setting.AppDataPath, excludes); err != nil {
fatal("Failed to include data directory: %v", err) fatal("Failed to include data directory: %v", err)