diff options
author | 6543 <6543@obermui.de> | 2020-12-02 19:36:06 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-02 18:36:06 +0000 |
commit | 2b4a08e9621e052845062ecd71ebfd37453c0383 (patch) | |
tree | 31d7ac557f570ea6aba5ca7e5bfd1f28a36f5729 /modules/repository | |
parent | fd1c3519c3435cbd09a2c065a6eeeb48bd81644e (diff) | |
download | gitea-2b4a08e9621e052845062ecd71ebfd37453c0383.tar.gz gitea-2b4a08e9621e052845062ecd71ebfd37453c0383.zip |
Migrations: Use Process Manager to create own Context (#13792)
Diffstat (limited to 'modules/repository')
-rw-r--r-- | modules/repository/repo.go | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/modules/repository/repo.go b/modules/repository/repo.go index b18dfddd2e..8ecb43ede6 100644 --- a/modules/repository/repo.go +++ b/modules/repository/repo.go @@ -5,6 +5,7 @@ package repository import ( + "context" "fmt" "path" "strings" @@ -41,7 +42,7 @@ func WikiRemoteURL(remote string) string { } // MigrateRepositoryGitData starts migrating git related data after created migrating repository -func MigrateRepositoryGitData(doer, u *models.User, repo *models.Repository, opts migration.MigrateOptions) (*models.Repository, error) { +func MigrateRepositoryGitData(ctx context.Context, u *models.User, repo *models.Repository, opts migration.MigrateOptions) (*models.Repository, error) { repoPath := models.RepoPath(u.Name, opts.RepoName) if u.IsOrganization() { @@ -61,7 +62,7 @@ func MigrateRepositoryGitData(doer, u *models.User, repo *models.Repository, opt return repo, fmt.Errorf("Failed to remove %s: %v", repoPath, err) } - if err = git.Clone(opts.CloneAddr, repoPath, git.CloneRepoOptions{ + if err = git.CloneWithContext(ctx, opts.CloneAddr, repoPath, git.CloneRepoOptions{ Mirror: true, Quiet: true, Timeout: migrateTimeout, @@ -77,7 +78,7 @@ func MigrateRepositoryGitData(doer, u *models.User, repo *models.Repository, opt return repo, fmt.Errorf("Failed to remove %s: %v", wikiPath, err) } - if err = git.Clone(wikiRemotePath, wikiPath, git.CloneRepoOptions{ + if err = git.CloneWithContext(ctx, wikiRemotePath, wikiPath, git.CloneRepoOptions{ Mirror: true, Quiet: true, Timeout: migrateTimeout, |