@@ -211,6 +211,11 @@ func runDump(ctx *cli.Context) error {
211
211
}
212
212
defer file .Close ()
213
213
214
+ absFileName , err := filepath .Abs (fileName )
215
+ if err != nil {
216
+ return err
217
+ }
218
+
214
219
verbose := ctx .Bool ("verbose" )
215
220
outType := ctx .String ("type" )
216
221
var iface interface {}
@@ -233,7 +238,7 @@ func runDump(ctx *cli.Context) error {
233
238
log .Info ("Skip dumping local repositories" )
234
239
} else {
235
240
log .Info ("Dumping local repositories... %s" , setting .RepoRootPath )
236
- if err := addRecursive (w , "repos" , setting .RepoRootPath , verbose ); err != nil {
241
+ if err := addRecursiveExclude (w , "repos" , setting .RepoRootPath , [] string { absFileName } , verbose ); err != nil {
237
242
fatal ("Failed to include repositories: %v" , err )
238
243
}
239
244
@@ -295,7 +300,7 @@ func runDump(ctx *cli.Context) error {
295
300
customDir , err := os .Stat (setting .CustomPath )
296
301
if err == nil && customDir .IsDir () {
297
302
if is , _ := isSubdir (setting .AppDataPath , setting .CustomPath ); ! is {
298
- if err := addRecursive (w , "custom" , setting .CustomPath , verbose ); err != nil {
303
+ if err := addRecursiveExclude (w , "custom" , setting .CustomPath , [] string { absFileName } , verbose ); err != nil {
299
304
fatal ("Failed to include custom: %v" , err )
300
305
}
301
306
} else {
@@ -325,6 +330,7 @@ func runDump(ctx *cli.Context) error {
325
330
excludes = append (excludes , setting .LFS .Path )
326
331
excludes = append (excludes , setting .Attachment .Path )
327
332
excludes = append (excludes , setting .LogRootPath )
333
+ excludes = append (excludes , absFileName )
328
334
if err := addRecursiveExclude (w , "data" , setting .AppDataPath , excludes , verbose ); err != nil {
329
335
fatal ("Failed to include data directory: %v" , err )
330
336
}
@@ -358,7 +364,7 @@ func runDump(ctx *cli.Context) error {
358
364
log .Error ("Unable to check if %s exists. Error: %v" , setting .LogRootPath , err )
359
365
}
360
366
if isExist {
361
- if err := addRecursive (w , "log" , setting .LogRootPath , verbose ); err != nil {
367
+ if err := addRecursiveExclude (w , "log" , setting .LogRootPath , [] string { absFileName } , verbose ); err != nil {
362
368
fatal ("Failed to include log: %v" , err )
363
369
}
364
370
}
0 commit comments