aboutsummaryrefslogtreecommitdiffstats
path: root/services/migrations
diff options
context:
space:
mode:
author6543 <6543@obermui.de>2022-02-06 20:01:47 +0100
committerGitHub <noreply@github.com>2022-02-06 20:01:47 +0100
commit3043eb36bfcd7ddf29202b958b91942826a8182b (patch)
treef6bfcb38648f07ff8132558ff826b8b1aac003ec /services/migrations
parent8ae5e6d7fdd577ebf0807bf33a4cdeef35d254d9 (diff)
downloadgitea-3043eb36bfcd7ddf29202b958b91942826a8182b.tar.gz
gitea-3043eb36bfcd7ddf29202b958b91942826a8182b.zip
Delete old git.NewCommand() and use it as git.NewCommandContext() (#18552)
Diffstat (limited to 'services/migrations')
-rw-r--r--services/migrations/dump.go2
-rw-r--r--services/migrations/gitea_uploader.go4
2 files changed, 3 insertions, 3 deletions
diff --git a/services/migrations/dump.go b/services/migrations/dump.go
index 1e4b3326b6..9a093ef298 100644
--- a/services/migrations/dump.go
+++ b/services/migrations/dump.go
@@ -476,7 +476,7 @@ func (g *RepositoryDumper) CreatePullRequests(prs ...*base.PullRequest) error {
}
if ok {
- _, err = git.NewCommandContext(g.ctx, "fetch", remote, pr.Head.Ref).RunInDir(g.gitPath())
+ _, err = git.NewCommand(g.ctx, "fetch", remote, pr.Head.Ref).RunInDir(g.gitPath())
if err != nil {
log.Error("Fetch branch from %s failed: %v", pr.Head.CloneURL, err)
} else {
diff --git a/services/migrations/gitea_uploader.go b/services/migrations/gitea_uploader.go
index 8f0505afc5..42b55e96b7 100644
--- a/services/migrations/gitea_uploader.go
+++ b/services/migrations/gitea_uploader.go
@@ -559,7 +559,7 @@ func (g *GiteaLocalUploader) newPullRequest(pr *base.PullRequest) (*models.PullR
}
if ok {
- _, err = git.NewCommandContext(g.ctx, "fetch", remote, pr.Head.Ref).RunInDir(g.repo.RepoPath())
+ _, err = git.NewCommand(g.ctx, "fetch", remote, pr.Head.Ref).RunInDir(g.repo.RepoPath())
if err != nil {
log.Error("Fetch branch from %s failed: %v", pr.Head.CloneURL, err)
} else {
@@ -583,7 +583,7 @@ func (g *GiteaLocalUploader) newPullRequest(pr *base.PullRequest) (*models.PullR
} else {
head = pr.Head.Ref
// Ensure the closed PR SHA still points to an existing ref
- _, err = git.NewCommandContext(g.ctx, "rev-list", "--quiet", "-1", pr.Head.SHA).RunInDir(g.repo.RepoPath())
+ _, err = git.NewCommand(g.ctx, "rev-list", "--quiet", "-1", pr.Head.SHA).RunInDir(g.repo.RepoPath())
if err != nil {
if pr.Head.SHA != "" {
// Git update-ref remove bad references with a relative path