mirror of
https://github.com/go-gitea/gitea.git
synced 2026-08-12 10:38:13 +00:00
refactor: remove Ctx field from git.Repository (#38500)
This commit is contained in:
@@ -108,14 +108,14 @@ func FixPublisherIDforTagReleases(ctx context.Context, x db.EngineMigration) err
|
||||
return err
|
||||
}
|
||||
}
|
||||
gitRepo, err = git.OpenRepository(ctx, repoPath(repo.OwnerName, repo.Name))
|
||||
gitRepo, err = git.OpenRepository(repoPath(repo.OwnerName, repo.Name))
|
||||
if err != nil {
|
||||
log.Error("Error whilst opening git repo for [%d]%s/%s. Error: %v", repo.ID, repo.OwnerName, repo.Name, err)
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
commit, err := gitRepo.GetTagCommit(release.TagName)
|
||||
commit, err := gitRepo.GetTagCommit(ctx, release.TagName)
|
||||
if err != nil {
|
||||
if git.IsErrNotExist(err) {
|
||||
log.Warn("Unable to find commit %s for Tag: %s in [%d]%s/%s. Cannot update publisher ID.", err.(git.ErrNotExist).ID, release.TagName, repo.ID, repo.OwnerName, repo.Name)
|
||||
@@ -127,7 +127,7 @@ func FixPublisherIDforTagReleases(ctx context.Context, x db.EngineMigration) err
|
||||
|
||||
if commit.Author.Email == "" {
|
||||
log.Warn("Tag: %s in Repo[%d]%s/%s does not have a tagger.", release.TagName, repo.ID, repo.OwnerName, repo.Name)
|
||||
commit, err = gitRepo.GetCommit(commit.ID.String())
|
||||
commit, err = gitRepo.GetCommit(ctx, commit.ID.String())
|
||||
if err != nil {
|
||||
if git.IsErrNotExist(err) {
|
||||
log.Warn("Unable to find commit %s for Tag: %s in [%d]%s/%s. Cannot update publisher ID.", err.(git.ErrNotExist).ID, release.TagName, repo.ID, repo.OwnerName, repo.Name)
|
||||
|
||||
@@ -87,7 +87,7 @@ func FixReleaseSha1OnReleaseTable(ctx context.Context, x db.EngineMigration) err
|
||||
userCache[repo.OwnerID] = user
|
||||
}
|
||||
|
||||
gitRepo, err = gitrepo.OpenRepository(ctx, repo_model.StorageRepo(repo_model.RelativePath(user.Name, repo.Name)))
|
||||
gitRepo, err = gitrepo.OpenRepository(repo_model.StorageRepo(repo_model.RelativePath(user.Name, repo.Name)))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -95,7 +95,7 @@ func FixReleaseSha1OnReleaseTable(ctx context.Context, x db.EngineMigration) err
|
||||
gitRepoCache[release.RepoID] = gitRepo
|
||||
}
|
||||
|
||||
release.Sha1, err = gitRepo.GetTagCommitID(release.TagName)
|
||||
release.Sha1, err = gitRepo.GetTagCommitID(ctx, release.TagName)
|
||||
if err != nil && !git.IsErrNotExist(err) {
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user