@@ -82,6 +82,10 @@ var CmdDump = &cli.Command{
82
82
Name : "skip-package-data" ,
83
83
Usage : "Skip package data" ,
84
84
},
85
+ & cli.BoolFlag {
86
+ Name : "skip-repo-archive" ,
87
+ Usage : "Skip repo archive data" ,
88
+ },
85
89
& cli.BoolFlag {
86
90
Name : "skip-index" ,
87
91
Usage : "Skip bleve index data" ,
@@ -265,6 +269,7 @@ func runDump(ctx context.Context, cmd *cli.Command) error {
265
269
excludes = append (excludes , setting .LFS .Storage .Path )
266
270
excludes = append (excludes , setting .Attachment .Storage .Path )
267
271
excludes = append (excludes , setting .Packages .Storage .Path )
272
+ excludes = append (excludes , setting .RepoArchive .Storage .Path )
268
273
excludes = append (excludes , setting .Log .RootPath )
269
274
if err := dumper .AddRecursiveExclude ("data" , setting .AppDataPath , excludes ); err != nil {
270
275
fatal ("Failed to include data directory: %v" , err )
@@ -297,6 +302,18 @@ func runDump(ctx context.Context, cmd *cli.Command) error {
297
302
fatal ("Failed to dump packages: %v" , err )
298
303
}
299
304
305
+ if cmd .IsSet ("skip-repo-archive" ) && cmd .Bool ("skip-repo-archive" ) {
306
+ log .Info ("Skip dumping repository archives" )
307
+ } else if err := storage .RepoArchives .IterateObjects ("" , func (objPath string , object storage.Object ) error {
308
+ info , err := object .Stat ()
309
+ if err != nil {
310
+ return err
311
+ }
312
+ return dumper .AddFileByReader (object , info , path .Join ("data" , "repo-archive" , objPath ))
313
+ }); err != nil {
314
+ fatal ("Failed to dump repository archives: %v" , err )
315
+ }
316
+
300
317
// Doesn't check if LogRootPath exists before processing --skip-log intentionally,
301
318
// ensuring that it's clear the dump is skipped whether the directory's initialized
302
319
// yet or not.
0 commit comments