summaryrefslogtreecommitdiffstats
path: root/services/migrations/dump.go
diff options
context:
space:
mode:
Diffstat (limited to 'services/migrations/dump.go')
-rw-r--r--services/migrations/dump.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/services/migrations/dump.go b/services/migrations/dump.go
index a9ec459519..f040c6c663 100644
--- a/services/migrations/dump.go
+++ b/services/migrations/dump.go
@@ -560,6 +560,10 @@ func (g *RepositoryDumper) Finish() error {
// DumpRepository dump repository according MigrateOptions to a local directory
func DumpRepository(ctx context.Context, baseDir, ownerName string, opts base.MigrateOptions) error {
+ doer, err := user_model.GetAdminUser()
+ if err != nil {
+ return err
+ }
downloader, err := newDownloader(ctx, ownerName, opts)
if err != nil {
return err
@@ -569,7 +573,7 @@ func DumpRepository(ctx context.Context, baseDir, ownerName string, opts base.Mi
return err
}
- if err := migrateRepository(downloader, uploader, opts, nil); err != nil {
+ if err := migrateRepository(doer, downloader, uploader, opts, nil); err != nil {
if err1 := uploader.Rollback(); err1 != nil {
log.Error("rollback failed: %v", err1)
}
@@ -641,7 +645,7 @@ func RestoreRepository(ctx context.Context, baseDir, ownerName, repoName string,
return err
}
- if err = migrateRepository(downloader, uploader, migrateOpts, nil); err != nil {
+ if err = migrateRepository(doer, downloader, uploader, migrateOpts, nil); err != nil {
if err1 := uploader.Rollback(); err1 != nil {
log.Error("rollback failed: %v", err1)
}